简体   繁体   English

vcprompt在提示中未设置修改和未提交

[英]vcprompt not setting modified and uncommitted in prompt

Using iTerm2 and-or Terminal on OSX - Ive got the lastest version of vcprompt installed and working to a point. 在OSX上使用iTerm2和/或终端-Ive安装了最新版本的vcprompt并可以正常工作。 I cant seem to get the format to reflect modified (+) and uncommitted (?) in my prompt. 我似乎无法在提示中得到反映修改(+)和未提交(?)的格式。
ie $user: path [git:branch +?] . $user: path [git:branch +?]

In .bash_login 在.bash_login中
print_before_prompt (){
printf "\\e[0;35m%s: \\e[0;36m%s \\e[0;33m%s\\e[0m \\n" "$USER" "$PWD" "$(vcprompt -f %n:%b %u%m)" }

GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
PROMPT_COMMAND=print_before_prompt
PS1="→ "
PS2=" > "

GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
PROMPT_COMMAND=print_before_prompt
PS1="→ "
PS2=" > "

GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
PROMPT_COMMAND=print_before_prompt
PS1="→ "
PS2=" > "


Also added bash.showDirtyState true
in --global git config file
but I dont get the indicators as expected: actually all it does is remove the [ ] from around [git:branch]. $user: path git:branch

I know this is pretty fringe but help on this would be great -- 我知道这是一个小问题,但对此会有所帮助-

You forgot to specify which vcprompt you're talking about -- I'm the author of the original C version ( https://bitbucket.org/gward/vcprompt ), but I know of at least two re-implementations which have "borrowed" the name vcprompt. 您忘记了指定要谈论的vcprompt -我是原始C版本( https://bitbucket.org/gward/vcprompt )的作者,但我知道至少有两个重新实现,其中包含“借用”的名称vcprompt。 Anyways, I can only answer for my version. 无论如何,我只能回答我的版本。

I don't think this feature was implemented for git when you posted your question originally, which would explain why it didn't work back then. 当您最初发布问题时,我认为git并未实现此功能,这可以解释为什么当时无法正常工作。

It should be working fine in the latest version of vcprompt (1.1 as I write this, 1.2 coming shortly). 在最新版本的vcprompt(我撰写本文时为1.1,不久之后为1.2)中,它应该可以正常工作。 I believe vcprompt 1.1 is packaged by homebrew for OS X, so it should be easy to install/upgrade. 我相信vcprompt 1.1是由Homebrew为OS X打包的,因此它应该易于安装/升级。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM