ConEmu with Git Bash - Show folder in tab bar

谁说我不能喝 提交于 2020-01-05 04:18:10

问题


I'm usually running Git Bash in ConEmu tabs. It would be really handy to show the name of the current directory in the tab bar for each instance of Git Bash, but if I set the tab template to %d or %f, I always get my Windows home directory, no matter where I cd to in Git Bash.

Is there a way to display the path in the tab bar? As you can see from the attached screenshot, I'm navigated to the banana folder, but ccook (my home dir) is shown in the tab.

The Title (%s) seems to contain the full path, but that's too long for my tabs.

The best I'm currently able to achieve is to use %s and add MINGW64 as a Skipped word from title, but that still gets me the full path instead of just the current folder. If there was a way to specify a regex I could exclude everything but the text after the final /.


回答1:


For Cygwin users, add PROMPT_COMMAND='ConEmuC -StoreCWD' to the .bashrc.

Per suggestion from @Jeffrey-Harmon

if [[ -n "${ConEmuPID}" ]]; then 
        PROMPT_COMMAND='ConEmuC -StoreCWD' 
fi

edit:

Looking at the documentation page, this suggestion is there as well now.

https://conemu.github.io/en/ShellWorkDir.html#bash_and_other_cygwin_shells



来源:https://stackoverflow.com/questions/39896401/conemu-with-git-bash-show-folder-in-tab-bar

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!