From cf086b057dfcc7c306450c70829b2788a3e64219 Mon Sep 17 00:00:00 2001 From: developic <172476898+developic@users.noreply.github.com> Date: Mon, 20 Jul 2026 17:35:29 +0530 Subject: [PATCH] Fish: repaint the prompt when exiting without selecting (#1257) --- templates/fish.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/fish.txt b/templates/fish.txt index fab533a..bf5bdf1 100644 --- a/templates/fish.txt +++ b/templates/fish.txt @@ -101,8 +101,12 @@ function __zoxide_z_complete # If the last argument is empty, use interactive selection. set -l query $tokens[2..-1] set -l result (command zoxide query --exclude (__zoxide_pwd) --interactive -- $query 2>/dev/null) - and builtin commandline --replace -- "{{ cmd.unwrap_or("cd") }} "(string escape -- $result) - and builtin commandline --function repaint execute + if test $status -eq 0 + builtin commandline --replace -- "{{ cmd.unwrap_or("cd") }} "(string escape -- $result) + builtin commandline --function repaint execute + else + builtin commandline --function repaint + end end end complete --command __zoxide_z --no-files --arguments '(__zoxide_z_complete)'