From f816fe157307fdd2b4d7ea84cce6aea2441c4b74 Mon Sep 17 00:00:00 2001 From: Ian Chesal Date: Thu, 16 Jun 2022 09:58:58 -0400 Subject: [PATCH] Guard kitty configuration We should only load these aliases into a terminal that's identifying itself as an xterm-kitty terminal. They're not useful in any other situation. --- plugins/kitty/kitty.plugin.zsh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/plugins/kitty/kitty.plugin.zsh b/plugins/kitty/kitty.plugin.zsh index 6e480dac6..1094236a7 100644 --- a/plugins/kitty/kitty.plugin.zsh +++ b/plugins/kitty/kitty.plugin.zsh @@ -2,12 +2,15 @@ # Kitty plugin for oh-my-zsh # ##################################################### -# kssh -# Use this when your terminfo isn't recognized on remote hosts. -# See: https://sw.kovidgoyal.net/kitty/faq/#i-get-errors-about-the-terminal-being-unknown-or-opening-the-terminal-failing-when-sshing-into-a-different-computer -alias kssh="kitty +kitten ssh" -# Use this if kssh fails -alias kssh-slow="infocmp -a xterm-kitty | ssh myserver tic -x -o \~/.terminfo /dev/stdin" +if [[ "$TERM" == 'xterm-kitty' ]]; then + ## kssh + # Use this when your terminfo isn't recognized on remote hosts. + # See: https://sw.kovidgoyal.net/kitty/faq/#i-get-errors-about-the-terminal-being-unknown-or-opening-the-terminal-failing-when-sshing-into-a-different-computer + alias kssh="kitty +kitten ssh" + compdef kssh='ssh' + # Use this if kssh fails + alias kssh-slow="infocmp -a xterm-kitty | ssh myserver tic -x -o \~/.terminfo /dev/stdin" -# Change the colour theme -alias kitty-theme="kitty +kitten themes" + # Change the colour theme + alias kitty-theme="kitty +kitten themes" +fi