prompt does not actualise on directory change

Bug #1674641 reported by Steve
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu (Ubuntu)
Invalid
Low
Unassigned

Bug Description

I try to add on "/usr/share/byobu/profiles/bashrc" some git info to the prompt by add the folloing:
...
               byobu_git_branch() {
                       git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
               }
...
PS1="${debian_chroot:+($debian_chroot)}\[\e[38;5;202m\]\$(byobu_prompt_status)\[\e[38;5;245m\]\u\[\e[00m\]@\[\e[38;5;172m\]\h\[\e[00m\]:\[\e[38;5;5m\]\w\[\033[01;31m\]$(byobu_git_branch)\[\e[00m\]\$(byobu_prompt_symbol) "
...
It is working if I "byobu-disable-prompt" and "byobu-enable-prompt" inside a git directory, but if I move outside ("cd .."), I still get the branch info. :-(

Changed in byobu (Ubuntu):
importance: Undecided → Low
Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Steve,

Hopefully you already figured this out. You just need to escape your $. Look at how byobu_prompt_symbol is called: "\$(byobu_prompt_symbol) "

Putting your string into my config let me reproduce your issue. Then when I changed it to this:

PS1="${debian_chroot:+($debian_chroot)}\[\e[38;5;202m\]\$(byobu_prompt_status)\[\e[38;5;245m\]\u\[\e[00m\]@\[\e[38;5;172m\]\h\[\e[00m\]:\[\e[38;5;5m\]\w\[\033[01;31m\]\$(byobu_git_branch)\[\e[00m\]\$(byobu_prompt_symbol) "

it started behaving correctly:

bryce@trent:~/ubuntu/Byobu$ cd byobu/
bryce@trent:~/ubuntu/Byobu/byobu(master)$ ls
Applications/ autogen.sh* CONTRIBUTING debian/ experimental/ NEWS README usr/
AUTHORS configure.ac COPYING etc/ Makefile.am po/ snap/
bryce@trent:~/ubuntu/Byobu/byobu(master)$ git branch
bryce@trent:~/ubuntu/Byobu/byobu(master)$ git checkout foobar
Switched to branch 'foobar'
bryce@trent:~/ubuntu/Byobu/byobu(foobar)$ cd ..
bryce@trent:~/ubuntu/Byobu$ pushd .
~/ubuntu/Byobu ~/ubuntu/Byobu
bryce@trent:~/ubuntu/Byobu$ cd byobu/
bryce@trent:~/ubuntu/Byobu/byobu(foobar)$ ls
Applications/ autogen.sh* CONTRIBUTING debian/ experimental/ NEWS README usr/
AUTHORS configure.ac COPYING etc/ Makefile.am po/ snap/
bryce@trent:~/ubuntu/Byobu/byobu(foobar)$ cd etc
bryce@trent:~/ubuntu/Byobu/byobu/etc(foobar)$ popd
~/ubuntu/Byobu
bryce@trent:~/ubuntu/Byobu$

Changed in byobu (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.