From ec33550cff41f803fc1907a13708daad72cbf090 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Tue, 23 Apr 2024 11:37:53 +0200 Subject: [PATCH] Fix detection of empty commandline in alt-d binding --- share/functions/__fish_shared_key_bindings.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/functions/__fish_shared_key_bindings.fish b/share/functions/__fish_shared_key_bindings.fish index 9c33c061c..3bb253173 100644 --- a/share/functions/__fish_shared_key_bindings.fish +++ b/share/functions/__fish_shared_key_bindings.fish @@ -85,7 +85,7 @@ function __fish_shared_key_bindings -d "Bindings shared between emacs and vi mod bind --preset $argv end end-of-line bind --preset $argv home beginning-of-line - bind --preset $argv alt-d 'if test "$(commandline)." = .; __fish_echo dirh; else; commandline -f kill-word; end' + bind --preset $argv alt-d 'if test "$(commandline; printf .)" = \n.; __fish_echo dirh; else; commandline -f kill-word; end' bind --preset $argv ctrl-d delete-or-exit bind --preset $argv alt-s 'for cmd in sudo doas please; if command -q $cmd; fish_commandline_prepend $cmd; break; end; end'