+++ This bug was initially created as a clone of Bug #620408 +++ Description of problem: Due to the fix of bug #142125 the default PROMPT_COMMAND has been set to a list of two commands. This causes strange behaviour when the output of a background process might get flushed after the output of the first PROMPT_COMMAND echo and hence appear between the escape sequences which mark the X terminal title. It also means the text doesn't appear in the terminal itself. Version-Release number of selected component (if applicable): bash-4.1.2-2.el6.x86_64 How reproducible: Sometimes Steps to Reproduce: 1. In xterm/gnome-terminal/Terminal run: yes & 2. while 'yes' is running: cat /var/log/yum.log (or whatever application which prints out something on the terminal and takes some time) 3. Look at the terminal title -- it would read something like "tsmetana@localhost:~/bash_testy y y y y y" 4. if not GOTO 2. Actual results: The text printed in the terminal title was not printed in the terminal window (this can be verified by running something else than 'yes' -- e.g. a simple c-program which outputs a number sequence) Expected results: The output of PROMPT_COMMAND shouldn't get mixed with the other text that goes to the terminal. Additional info: There is a simple way to check the more commands in PROMPT_COMMAND can have unusual consequence -- try to add sleep between the two commands: export PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/~}"; sleep 1; echo -ne "\007"' Now just press enter and some random keys on the keyboard, then look at the xterm title -- it would contain the keys you pressed. Note that the sleep only increases the chance for this to happen. I'm not actually sure how to solve the problem properly: maybe the bug #142125 has to be fixed some other way and PROMPT_COMMAND should be reverted to the old value with just one echo command. --- Additional comment from rrakus on 2010-08-02 09:42:28 EDT --- I guess we should use `printf' instead of `echo'. --- Additional comment from rrakus on 2010-08-02 10:08:23 EDT --- PROMPT_COMMAND='printf "\033]0;%s@%s:%s\007" "${USER}" "${HOSTNAME%%.*}" "${PWD/#HOME/~}"' works for me. Reassigning to setup.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2012-0198.html