summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Chesal <ian.chesal@gmail.com>2024-05-28 17:40:30 -0400
committerGitHub <noreply@github.com>2024-05-28 14:40:30 -0700
commit071b8f8921cb2bbb1fcabbf3d271e77af0b12a7d (patch)
tree8658b4ae28eb33e6046433a1a4e21aadcb04c91b
parent5e59d21e5465ec0694441f41ff0acf1ddf4de187 (diff)
downloadzsh-071b8f8921cb2bbb1fcabbf3d271e77af0b12a7d.tar.gz
zsh-071b8f8921cb2bbb1fcabbf3d271e77af0b12a7d.tar.bz2
zsh-071b8f8921cb2bbb1fcabbf3d271e77af0b12a7d.zip
feat(kitty): add plugin for the kitty terminal (#10994)
* A plugin for the Kitty terminal Provides a handful of useful aliases for anyone working in a Kitty terminal. In particular, the kssh command is handy for ensuring that terminfo is set correctly on remote hosts when you ssh to them. * 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.
-rw-r--r--plugins/kitty/README.md23
-rw-r--r--plugins/kitty/kitty.plugin.zsh16
2 files changed, 39 insertions, 0 deletions
diff --git a/plugins/kitty/README.md b/plugins/kitty/README.md
new file mode 100644
index 000000000..ec9e375de
--- /dev/null
+++ b/plugins/kitty/README.md
@@ -0,0 +1,23 @@
+# Kitty plugin
+
+This plugin adds a few aliases and functions that are useful for users of the [Kitty](https://sw.kovidgoyal.net/kitty/) terminal.
+
+To use it, add _kitty_ to the plugins array of your zshrc file:
+```
+plugins=(... kitty)
+```
+
+## Plugin commands
+
+* `kssh`
+ Runs a kitten ssh session that ensures your terminfo settings are copied
+ correctly to the remote hose.
+* `kssh-slow`
+ A slower form of `kssh` that should always work. Use this if `kssh` fails
+ to set terminfo correctly for you on the remote host.
+* `kitty-theme`
+ Browse and change the theme of your Kitty terminal.
+
+## Contributors
+
+- [Ian Chesal](https://github.com/ianchesal)
diff --git a/plugins/kitty/kitty.plugin.zsh b/plugins/kitty/kitty.plugin.zsh
new file mode 100644
index 000000000..1094236a7
--- /dev/null
+++ b/plugins/kitty/kitty.plugin.zsh
@@ -0,0 +1,16 @@
+#####################################################
+# Kitty plugin for oh-my-zsh #
+#####################################################
+
+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"
+fi