From 01ef149ff201678fab9729279485b30d04059389 Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Tue, 11 Jul 2023 14:20:39 +0300 Subject: [PATCH] Run ssh in subshell with custom TERM if needed Remote systems usually don't have alacritty terminfo --- .zshrc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.zshrc b/.zshrc index a027ee6..f9f490d 100644 --- a/.zshrc +++ b/.zshrc @@ -202,9 +202,6 @@ alias htop="htop -d 10" alias ip="ip -color=auto" alias cp="cp --reflink=auto" alias gitg="LANG=en_US.UTF-8 gitg" -if [[ "$TERM" == "alacritty" ]]; then - alias ssh='TERM=xterm-256color ssh' -fi export EDITOR=nvim export VISUAL=nvim @@ -267,7 +264,17 @@ function npm { ( export COLOR=1 export REACT_APP_NO_CLEAR_CONSOLE=1 - /usr/bin/npm $@ | cat + exec /usr/bin/npm $@ | cat + ) +} + + +function ssh { + ( + if [[ "$TERM" == "alacritty" ]]; then + export TERM=xterm-256color + fi + exec /usr/bin/ssh $@ ) }