From 7dec7d615af718dd0f0b2ebba1900e77b9d12a44 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 15 Jul 2021 07:55:30 +0530 Subject: [PATCH] Use an env var to control shell integration --- shell-integration/kitty.zsh | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/shell-integration/kitty.zsh b/shell-integration/kitty.zsh index 4953e2478..c8e148e9b 100644 --- a/shell-integration/kitty.zsh +++ b/shell-integration/kitty.zsh @@ -1,13 +1,12 @@ -local args -typeset -a args -args=($@) () { if [[ ! -o interactive ]]; then return; fi - + if [[ -z "$kitty_shell_integration" ]]; then return; fi typeset -g -A kitty_prompt=([state]='first-run' [cursor]='y' [title]='y') - - (( ${args[(I)no-cursor]} )) && kitty_prompt[cursor]="n" - (( ${args[(I)no-title]} )) && kitty_prompt[title]="n" + for i in ${=kitty_shell_integration}; do + if [[ "$i" == "no-cursor" ]]; then kitty_prompt[cursor]='n'; fi + if [[ "$i" == "no-title" ]]; then kitty_prompt[title]='n'; fi + done + unset kitty_shell_integration function debug() { # print a line to STDOUT of parent kitty process