Thread (10 messages) 10 messages, 3 authors, 2024-10-24

Re: bash prompt evaporates in subdirectories

From: Matěj Cepl <hidden>
Date: 2024-10-24 13:33:12

On Thu Oct 24, 2024 at 1:46 PM CEST, avih wrote:
- What is the "innermost" distro where this happens? Thumbleweed?
  which version?
Yes, Tumbleweed (actually MicroOS uses Tumbleweed packages as
well), which is a rolling distro and I updated (almost) daily, so
it is hard to say which version.
- Which git version do you have installed? How did you install it?
mitmanek:~ $ rpm -qf "$(which git)"
git-core-2.47.0-1.1.x86_64
mitmanek:~ $ 
- How did you install the git-prompt support?
Using the git-prompt.sh from the package, but it seems to be the same as the upstream one in contrib/

mitmanek:~ $ rpm -qf /bin/bash
bash-5.2.37-14.2.x86_64
mitmanek:~ $ rpm -qf /usr/share/bash-completion/completions/git-prompt.sh
git-core-2.47.0-1.1.x86_64
mitmanek:~ $ diff -u \
    /usr/share/bash-completion/completions/git-prompt.sh \
    <(curl -L -s https://github.com/git/git/raw/refs/heads/master/contrib/completion/git-prompt.sh)
mitmanek:~ $ 
- Which shell do you use? (bash? zsh? something else?)
bash with ble.sh (freshly updated, but the problem can be reproduced even without it)
- How is the (git) prompt set in your shell startup file? (~/.bashrc,
  or ~/.profile, etc). If you don't know exactly, then can you please
  attach your shell startup files?
* /etc/bash.bashrc is
  https://mcepl.fedorapeople.org/tmp/bash.bashrc (the
  standard openSUSE one with the addition of loading
  /etc/profile.d/distrobox_profile.sh)
* /etc/profile is https://mcepl.fedorapeople.org/tmp/profile
  (git is not mentioned anywhere in /etc/profile.d)
* /etc/bash_completion.d/git-prompt is
  https://mcepl.fedorapeople.org/tmp/git-prompt (so, yes
  git-prompt may be attempted to be loaded twice)
* /etc/profile.d/distrobox_profile.sh is
  https://mcepl.fedorapeople.org/tmp/distrobox_profile.sh
* ~/.bashrc is https://mcepl.fedorapeople.org/tmp/bashrc
* ~/.config/blesh/init.sh is
  https://mcepl.fedorapeople.org/tmp/init.sh
- Can you provide a sample repository to clone which reproduces the
  issue? for instance, you can pick a small repo from github.
Basically any git repository which has more than one
level of directories, I spent most of my time in
https://git.sr.ht/~mcepl/m2crypto, so when I do `cd src` the git
status evaporates.
- What are the steps to reproduce the issue? is it enough to "cd"
  into an existing sub-dir at the git dir? or is it only broken
  when creating an unrelated sub-dir and "cd" into it? better yet,
  provide a 1:... 2:... 3:... steps which reproduce the issue for
  you, and which others can try to follow.
Yes, just run `cat <(curl -L -s https://mcepl.fedorapeople.org/tmp/typescript)`
   sudo zypper install bash-git-prompt
I don’t have this package installed at all, using the script from git-core.
     . ~/git-prompt.sh
     PS1='\w$(__git_ps1)\n\$ '
Yes, that works:

mitmanek:~ $ export PS1='\w$(__git_ps1)\n\$ '
~
$ ~/repos/m2crypto
cd -- /home/matej/repos/m2crypto
~/repos/m2crypto (master $)
$ cd src
~/repos/m2crypto/src (master $)
$ 

So, the problem is somewhere in my too complicated configuration. Any idea, where?

Thank you for your help so far!

Matěj

-- 
http://matej.ceplovi.cz/blog/, @mcepl@floss.social
GPG Finger: 3C76 A027 CA45 AD70 98B5  BC1D 7920 5802 880B C9D8
 
Books aren’t written - they’re rewritten. Including your own. It
is one of the hardest things to accept, especially after the
seventh rewrite hasn’t quite done it.
  -- Michael Crichton, alluding to Steele MacKaye (1889) article
     where he said this about theater plays.

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help