From dfa5f5e4248194338cd41780b5d0e87f9096b0b0 Mon Sep 17 00:00:00 2001 From: Jonathan Hodgson Date: Sun, 21 Mar 2021 12:57:57 +0000 Subject: [PATCH] Deletes focus zsh file --- shells/zsh/includes/focus.zsh | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 shells/zsh/includes/focus.zsh diff --git a/shells/zsh/includes/focus.zsh b/shells/zsh/includes/focus.zsh deleted file mode 100644 index 14cf6b39..00000000 --- a/shells/zsh/includes/focus.zsh +++ /dev/null @@ -1,33 +0,0 @@ -#Gain focus -gain_focus(){ - export HASFOCUS="true" - set_prompts - zle reset-prompt -} -zle -N gain_focus -bindkey '\033[I' gain_focus # Gain Focus - -loose_focus(){ - export HASFOCUS="false" - set_prompts - zle reset-prompt -} -zle -N loose_focus -bindkey '\033[O' loose_focus # Loose Focus - -# Stop terminal from sending focus events before a process runs -# This eliviates the issue of getting weird characters when a read (or similar) prompt is visible -dont_listen_for_focus(){ - printf '\033[?1004l' -} -add-zsh-hook preexec dont_listen_for_focus - -# Make the terminal send focus events again when the prompt is being drawn -# This almost works, although, if a long running process finishes in the background, that terminal will still look like it has focus -listen_for_focus(){ - # This makes sc (and maybe other terminals?) send escape codes to the shell when focus is gained / lost - printf '\033[?1004h' -} -add-zsh-hook precmd listen_for_focus - -HASFOCUS="true"