1
0
Fork 0

tcmp function

This commit is contained in:
Von Random 2018-07-06 19:36:00 +03:00
parent 88a6e0da15
commit 5e6c4b6caa

8
zshrc
View file

@ -153,6 +153,7 @@ alias rgrep='command grep --exclude-dir=\.git -R'
alias ggrep='command git grep' alias ggrep='command git grep'
alias tailf='command less -R +F' alias tailf='command less -R +F'
alias diff='command diff --color' alias diff='command diff --color'
alias s='tcmp ssh'
# ls # ls
alias ls='command ls --color=auto --group-directories-first ' alias ls='command ls --color=auto --group-directories-first '
@ -207,14 +208,13 @@ greset() {
/usr/bin/git clean -fd /usr/bin/git clean -fd
/usr/bin/git reset --hard /usr/bin/git reset --hard
} }
# ssh-compat, when terminfo is missing # term compatibility for remote stuff
s() { tcmp() {
local ssh=$(whence ssh)
local -A terms=( local -A terms=(
'rxvt-unicode-256color' 'rxvt-unicode' 'rxvt-unicode-256color' 'rxvt-unicode'
'st-256color' 'xterm-256color' 'st-256color' 'xterm-256color'
'tmux-256color' 'screen-256color' 'tmux-256color' 'screen-256color'
) )
TERM=${terms[$TERM]:-$TERM} $ssh "$@" TERM=${terms[$TERM]:-$TERM} "$@"
} }
# }}} # }}}