From f9cdda2e559b72d6a59ce812b09024c71d9e8fa9 Mon Sep 17 00:00:00 2001 From: Jeremy Kaplan Date: Tue, 7 Jun 2016 16:52:32 -0400 Subject: [PATCH] Fix ssh handling in zsh --- zsh/.zshenv | 8 ++++---- zsh/.zshrc | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/zsh/.zshenv b/zsh/.zshenv index 16c1271..c7f2a31 100644 --- a/zsh/.zshenv +++ b/zsh/.zshenv @@ -8,10 +8,10 @@ source /usr/bin/virtualenvwrapper.sh export XDG_CONFIG_HOME=$HOME/.config -if [ -n "$SSH_CLIENT" ] || [ -n "$SSH_CLIENT" ] || [ -n "$SSH_CLIENT" ]; then - SHELL_TYPE='remote/ssh' +if [ -n "$SSH_TTY" ] || [ -n "$SSH_CLIENT" ] || [ -n "$SSH_CONNECTION" ]; then + LOCAL_SESSION=0 else - SHELL_TYPE='local' + LOCAL_SESSION=1 fi -export SHELL_TYPE +export LOCAL_SESSION diff --git a/zsh/.zshrc b/zsh/.zshrc index 9d589f2..fc1d0c4 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -50,16 +50,18 @@ local lbrkt="${gray}[%f" local rbrkt="${gray}]%f" local colon="${gray}:%f" local user="${purple}%n%f" -if [[ $SHELL_TYPE == "local" ]]; then +if [[ $LOCAL_SESSION -eq 1 ]]; then local host="${blue}%m%f" + local prompt="%# " else local host="${red}%m%f" + local prompt="${red}%#%f " fi local dir="${green}%~%f" local branch="\$(parse_git_branch)" setopt prompt_subst -export PROMPT="%# " +export PROMPT="${prompt}" export RPROMPT="${lbrkt}${user}${colon}${host}${colon}${dir}${branch}${rbrkt}" # aliases