-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Confused whether inside command "vcsh enter <repo_name>" or already quit #297
Comments
Changing |
Like Richard said, a command line tool manipulating the parent shell is kind of a minefield situation and it would not be appropriate for VCSH to do this and at the same time expect the user's regular shell to work. The only way we could handle this more directly is with a REPL interface that doesn't claim to be a full shell following the user's other preferences. Also like he said typeset -g POWERLEVEL9K_CUSTOM_VCSH=zsh_vcsh
typeset -g POWERLEVEL9K_CUSTOM_VCSH_BACKGROUND='202'
typeset -g POWERLEVEL9K_CUSTOM_VCSH_FOREGROUND='234'
zsh_vcsh () {
echo -n ${VCSH_REPO_NAME}
}
typeset -g POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(root_indicator user host dir custom_vcsh vcs) The resulting shell prompt before and after entering a VCSH repo looks like this: Another thing to mention if it interests you is that the next version of starship (v0.52.0) will include out of the box support for showing VCSH information. You can use the Git HEAD version now or check it out after the next release. Support was contributed here. Some sample configs for various shells in the docs would probably be a good plan. |
Thank you @RichiH and @alerque for your fast reply, I'd totally agree with your observation: the usage of variable VCSH_REPO_NAME would be more than enough and safer. From my point of view it could be helpful to highlight such usage into the docs. The idea of updating the PS1 was stolen from virtualenv, but I agree that - safety apart - sometimes it is also really annoying especially when it messes with the console layout. |
I understand this issue might be resolved for you, but lets keep the issue open to track getting this end of things better documented for other first time users. If it's noisy for you you can unsubscribe from notifications to this issue from the sidebar. |
Out of the box support for VCSH info in the prompt shipped in Starship v0.52.1. |
Hi,
often I use the command enter is order to do some action on a specific repository.
The issue that I'm facing is that - maybe due low brain's memory resources - I forget if I'm still inside the vcsh subshell or if I already quit it. Therefore at current time I've aliased the command to the following:
Do you thing could make sense integrate such functionality into vcsh itself? It would be enough to patch appropriately where the variable
$SHELL
is used.For bash could work something like like:
bash --rcfile <(echo "PS1=\"(change) ${PS1}\"")
The text was updated successfully, but these errors were encountered: