我正在使用git aware prompt,并希望将其与路径名的缩短版本集成在一起
缩短的pwd是用动态创建的
python ~/.short.pwd.py和git-aware prompt命令是
export GITAWAREPROMPT=~/.bash/git-aware-prompt
source "${GITAWAREPROMPT}/main.sh"
export PS1="\${debian_chroot:+(\$debian_chroot)}\u@\h:\w \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "我尝试过使用$debian_chroot或\u@\h:\w与(python ~/.short.pwd.py)的一些混合,但没有成功,但我不是bash专家。
有谁知道如何合并它们,所以我会得到最短路径指示和git-aware-prompt?
谢谢!
发布于 2016-09-22 02:29:41
我在评论中通过@chepner帮助解决了这个问题,用$(python ~/.short.pwd.py)替换了\u@\h:\w。
最后,更新后的export是
export PS1="\${debian_chroot:+(\$debian_chroot)}\$(python ~/.short.pwd.py) \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "https://stackoverflow.com/questions/39622310
复制相似问题