From dff03a8f1d2a0770503659b8b13eea3c58e328fd Mon Sep 17 00:00:00 2001 From: Youwen Wu Date: Tue, 11 Feb 2025 14:04:33 -0800 Subject: [PATCH] fix(nushell): use hack to get string escaped completions --- hm/modules/common/shellenv/config.nu | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/hm/modules/common/shellenv/config.nu b/hm/modules/common/shellenv/config.nu index e102380..a1b809a 100644 --- a/hm/modules/common/shellenv/config.nu +++ b/hm/modules/common/shellenv/config.nu @@ -1,7 +1,12 @@ let fish_completer = {|spans| - fish --command $'complete "--do-complete=($spans | str join " ")"' - | from tsv --flexible --noheaders --no-infer - | rename value description + fish --command $'complete --escape "--do-complete=($spans | str join " ")"' + | $"value(char tab)description(char newline)" + $in + | from tsv --flexible --no-infer + | each {|i| + if '\' in $i.value { + $i | merge {'value': $"\"($i.value | str replace -a '\' '')\""} + } else {$i} + } } let zoxide_completer = {|spans|