/
Trying to use custom prompt with Git [1]
Trying to use custom prompt with Git [1]
Trying to use custom prompt with Git
Monday, April 3, 2017 10:38 PM - Davis
Recently I've been trying to learn how to use Git.
I completed the related courses on FreeCodeCamp and started using Mintty terminal (from Git Bash install) as my terminal.
FreeCodeCamp also had some cool settings to add to the .bash_profile that customized the Terminal prompt:
# generated by Git for Windows
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
# Enable tab completion
source ~/git-completion.bash
# colors!
green="\[\033[0;32m\]"
blue="\[\033[0;34m\]"
purple="\[\033[0;35m\]"
reset="\[\033[0m\]"
# Change command prompt
source ~/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
# '\u' adds the name of the current user to the prompt
# '\$(__git_ps1)' adds git-related stuff
# '\W' adds the name of the current directory
export PS1="$purple\u$green\$(__git_ps1)$blue \W $ $reset"
This weekend I discovered Xshell....which seems like an even more useful Terminal Emulator. However, it doesn't seem to utilize the .bash_profile settings (which Mintty, CMDer did).
Can someone explain why, how, etc I would go about getting it to load similar?
Program Ver. : Xshell 5
I completed the related courses on FreeCodeCamp and started using Mintty terminal (from Git Bash install) as my terminal.
FreeCodeCamp also had some cool settings to add to the .bash_profile that customized the Terminal prompt:
# generated by Git for Windows
test -f ~/.profile && . ~/.profile
test -f ~/.bashrc && . ~/.bashrc
# Enable tab completion
source ~/git-completion.bash
# colors!
green="\[\033[0;32m\]"
blue="\[\033[0;34m\]"
purple="\[\033[0;35m\]"
reset="\[\033[0m\]"
# Change command prompt
source ~/git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
# '\u' adds the name of the current user to the prompt
# '\$(__git_ps1)' adds git-related stuff
# '\W' adds the name of the current directory
export PS1="$purple\u$green\$(__git_ps1)$blue \W $ $reset"
This weekend I discovered Xshell....which seems like an even more useful Terminal Emulator. However, it doesn't seem to utilize the .bash_profile settings (which Mintty, CMDer did).
Can someone explain why, how, etc I would go about getting it to load similar?
Program Ver. : Xshell 5
Re: Trying to use custom prompt with Git
Friday, April 7, 2017 8:29 PM - Support
Your script seems to be working well.
Bash can use .bashrc as its startup file if the shell was called as a non login, such as an su command without the '-' parameter.
Please provide detailed instructions and screenshots to help us further investigate this issue.
Technical Support
Like us on Facebook
Follow us on Twitter
Visit our blog Blog
Bash can use .bashrc as its startup file if the shell was called as a non login, such as an su command without the '-' parameter.
Please provide detailed instructions and screenshots to help us further investigate this issue.
Technical Support
Like us on Facebook
Follow us on Twitter
Visit our blog Blog
Previous views: 139
Related content
Tab auto-completion doesn't work in local shells [2]
Tab auto-completion doesn't work in local shells [2]
More like this
Feature enhancement [1]
Feature enhancement [1]
More like this
How to display colors
How to display colors
More like this
ZSH에서 여러 줄에 걸친 프롬프트 문자열이 터미널 크기가 변경될 때 잘못 출력되는 경우
ZSH에서 여러 줄에 걸친 프롬프트 문자열이 터미널 크기가 변경될 때 잘못 출력되는 경우
More like this
Xshell4에서의 ls 시 color 설정이 안됩니다. [1]
Xshell4에서의 ls 시 color 설정이 안됩니다. [1]
More like this
Appearance _ Window
Appearance _ Window
More like this