From 43b8bbcc2f4817a3c8e2c2eb410c7d6f0a68d567 Mon Sep 17 00:00:00 2001 From: developic <172476898+developic@users.noreply.github.com> Date: Sat, 4 Jul 2026 12:22:07 +0530 Subject: [PATCH] # Fix: repaint the prompt when exiting without selecting aka adding a fallback When the interactive picker is canceled without selecting a value, zoxide query --interactive returns no result...... The function had no fallback for this case, so it left the command line in a broken state... --- templates/fish.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/templates/fish.txt b/templates/fish.txt index fab533a..6ad10c5 100644 --- a/templates/fish.txt +++ b/templates/fish.txt @@ -101,8 +101,13 @@ 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 --function repaint + return + else + builtin commandline --replace -- "{{ cmd.unwrap_or("cd") }} "(string escape -- $result) + builtin commandline --function repaint execute + end end end complete --command __zoxide_z --no-files --arguments '(__zoxide_z_complete)'