Fix ssh handling in zsh
This commit is contained in:
parent
098d641c8e
commit
f9cdda2e55
2 changed files with 8 additions and 6 deletions
|
|
@ -8,10 +8,10 @@ source /usr/bin/virtualenvwrapper.sh
|
||||||
|
|
||||||
export XDG_CONFIG_HOME=$HOME/.config
|
export XDG_CONFIG_HOME=$HOME/.config
|
||||||
|
|
||||||
if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_CLIENT" ] || [ -n "$SSH_CLIENT" ]; then
|
if [ -n "$SSH_TTY" ] || [ -n "$SSH_CLIENT" ] || [ -n "$SSH_CONNECTION" ]; then
|
||||||
SHELL_TYPE='remote/ssh'
|
LOCAL_SESSION=0
|
||||||
else
|
else
|
||||||
SHELL_TYPE='local'
|
LOCAL_SESSION=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export SHELL_TYPE
|
export LOCAL_SESSION
|
||||||
|
|
|
||||||
|
|
@ -50,16 +50,18 @@ local lbrkt="${gray}[%f"
|
||||||
local rbrkt="${gray}]%f"
|
local rbrkt="${gray}]%f"
|
||||||
local colon="${gray}:%f"
|
local colon="${gray}:%f"
|
||||||
local user="${purple}%n%f"
|
local user="${purple}%n%f"
|
||||||
if [[ $SHELL_TYPE == "local" ]]; then
|
if [[ $LOCAL_SESSION -eq 1 ]]; then
|
||||||
local host="${blue}%m%f"
|
local host="${blue}%m%f"
|
||||||
|
local prompt="%# "
|
||||||
else
|
else
|
||||||
local host="${red}%m%f"
|
local host="${red}%m%f"
|
||||||
|
local prompt="${red}%#%f "
|
||||||
fi
|
fi
|
||||||
local dir="${green}%~%f"
|
local dir="${green}%~%f"
|
||||||
local branch="\$(parse_git_branch)"
|
local branch="\$(parse_git_branch)"
|
||||||
|
|
||||||
setopt prompt_subst
|
setopt prompt_subst
|
||||||
export PROMPT="%# "
|
export PROMPT="${prompt}"
|
||||||
export RPROMPT="${lbrkt}${user}${colon}${host}${colon}${dir}${branch}${rbrkt}"
|
export RPROMPT="${lbrkt}${user}${colon}${host}${colon}${dir}${branch}${rbrkt}"
|
||||||
|
|
||||||
# aliases
|
# aliases
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue