From 39905d41354358471c41b0f5de2d043f204ca0db Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 1 Jun 2018 20:26:54 +0200 Subject: [PATCH] Skip fish_vi_cursor when not interactive This prints an escape sequence, so it can break scp or similar when someone has an unqualified fish_vi_key_bindings in config.fish and happens to run a terminal that can set the cursor. --- share/functions/fish_vi_cursor.fish | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/share/functions/fish_vi_cursor.fish b/share/functions/fish_vi_cursor.fish index b667c5464..27a20083f 100644 --- a/share/functions/fish_vi_cursor.fish +++ b/share/functions/fish_vi_cursor.fish @@ -13,6 +13,11 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes' # But since tmux in konsole seems rather common and that case so uncommon, # we will just fail there (though it seems that tmux or st swallow it anyway). + # If we're not interactive, there is effectively no bind mode. + if not status is-interactive + return + end + if set -q INSIDE_EMACS return end