You are not logged in.

#1 2009-09-24 21:55:55

ptepid
Member
Registered: 2006-07-03
Posts: 9

SOLVED: bash upgrade, prompt issues

Just did a pacman -Syu and it fetched bash-4.0.033-1. However now whenever a open a bash shell as a user (not root), my prompt has this at the start:
0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~} (~)

... followed by the usual [user@host ~]$

Now I assume this is caused by this line in profile.bash:
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"'
export PROMPT_COMMAND

Unfortunately there is no backup of said file, so I have no idea what this line used to look like. I'm going to hazard a guess that "\033]0;" should be a "[", and "\007" should be "]".

Edit: Forgot to mention that I'm using rxvt-unicode for the terminal.

Edit2: It seems the relevant file was /etc/bash.bashrc, and the solution was to simply remove rxvt-unicode from the if statement.

Last edited by ptepid (2009-09-26 11:12:25)

Offline

#2 2009-09-25 01:41:56

DEBIAN SOCIAL CONTRACT
Member
Registered: 2009-09-24
Posts: 6

Re: SOLVED: bash upgrade, prompt issues

bash.bashrc won't get sourced on a default arch system.

Where do I report bash.bashrc vs profile.bash? The bug tracker doesn't seem like the proper place.

Since the last bash/bash-completion update, bash-completion doesn't get sourced in by /etc/profile calling /etc/profile.d/. It get's sourced by bash.bashrc, a file that doesn't get sourced by anything!

Offline

#3 2009-09-25 05:42:14

kgas
Member
From: Qatar
Registered: 2008-11-08
Posts: 718

Re: SOLVED: bash upgrade, prompt issues

I hope this About bashrc will clarify the doubts

Offline

#4 2009-09-25 06:55:14

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: SOLVED: bash upgrade, prompt issues

I don't see any problem with the prompt ...

[xavier@xps-m1530 ~]$ source /etc/bash.bashrc 
[xavier@xps-m1530 ~]$ echo $TERM
rxvt-unicode
[xavier@xps-m1530 ~]$ echo $PROMPT_COMMAND 
echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/$HOME/~}\007"

pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#5 2009-09-26 11:03:24

ptepid
Member
Registered: 2006-07-03
Posts: 9

Re: SOLVED: bash upgrade, prompt issues

Okay, there's something else going on here. I just happened to be messing with ANSI escape codes for something else and the same issue arose.

For instance

[ptepid@securis ~]$ echo -e "Test1 \033[1;34m Test2 \033[0m"
1;34m Test2  (~)Test1  Test2 
[ptepid@securis ~]$

That echo statement should print "Test1 Test2" with test2 in blue (not shown here). It does that, but it's also spitting out the escape codes as garbage beforehand.
Turns out only one user is affected. I'm trying to hunt down what is causing it, but I can't find any ENV variables that are different. It's only happening in X, but it's a problem with both rxvt and rxvt-unicode.

SOLVED: Okay, now I feel pretty dumb. It was some bogus code in my .bashrc that was meant to update the titlebar of an xterm. That worked, but it also seems to mess with ANSI escape characters. This was the offending code:

if [[ -n "$DISPLAY" ]]; then
  if [[ -n $MRXVT_TABTITLE ]]; then
    trap 'echo -ne "\e]61;${BASH_COMMAND//\"/} (${PWD/$HOME/~})\a"' DEBUG
  else
    trap 'echo -ne "\e]0;${BASH_COMMAND//\"/} (${PWD/$HOME/~})\a"' DEBUG
  fi
fi

A relic from when I'd used mrxvt.

Last edited by ptepid (2009-09-26 11:11:55)

Offline

#6 2009-09-26 11:08:19

shining
Pacman Developer
Registered: 2006-05-10
Posts: 2,043

Re: SOLVED: bash upgrade, prompt issues

Did you try to disable your .Xdefaults / .Xresources / etc settings ?

Edit : and .bashrc of course. lol

Last edited by shining (2009-09-26 11:21:24)


pacman roulette : pacman -S $(pacman -Slq | LANG=C sort -R | head -n $((RANDOM % 10)))

Offline

#7 2009-09-26 14:35:10

ptepid
Member
Registered: 2006-07-03
Posts: 9

Re: SOLVED: bash upgrade, prompt issues

shining wrote:

Did you try to disable your .Xdefaults / .Xresources / etc settings ?

Edit : and .bashrc of course. lol

Hehe, cheers. wink

Still not sure why this only occurred after the bash update. I hadn't altered the .bashrc in months.

Offline

Board footer

Powered by FluxBB