From a5dfa84f73cc4f23e549e3c9bcb35e2612b4fe31 Mon Sep 17 00:00:00 2001 From: bitraid Date: Tue, 14 Nov 2023 19:09:04 +0200 Subject: [PATCH] fish_vi_cursor: skip if stdin is not a tty Instead of skipping for non-interactive shells, skip when stdin is not a tty. This allows the cursor to be set for scripts that use the `read` command. --- share/functions/fish_vi_cursor.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/functions/fish_vi_cursor.fish b/share/functions/fish_vi_cursor.fish index 3f1e7bbc6..f58d45f50 100644 --- a/share/functions/fish_vi_cursor.fish +++ b/share/functions/fish_vi_cursor.fish @@ -1,6 +1,6 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes' - # If we're not interactive, there is effectively no bind mode. - if not status is-interactive + # if stdin is not a tty, there is effectively no bind mode. + if not test -t 0 return end