From b9c2191d25ac50c1b71d17dab1eec8cc3d9433cb Mon Sep 17 00:00:00 2001 From: WriterV2 Date: Sun, 4 Oct 2026 13:34:34 +0200 Subject: Nushell: Update fish completer config to replace deprecated `spans` with `$place.command` --- .config/nushell/config.nu | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to '.config') diff --git a/.config/nushell/config.nu b/.config/nushell/config.nu index 0955ef7..3461d15 100644 --- a/.config/nushell/config.nu +++ b/.config/nushell/config.nu @@ -1,7 +1,15 @@ -let completer = {|spans| - fish --command $'complete "--do-complete=($spans | str join " ")"' +let completer = {|place| + fish --command $"complete '--do-complete=($place.command | str replace --all "'" "\\'" | str join ' ')'" | from tsv --flexible --noheaders --no-infer | rename value description + | update value {|row| + let value = $row.value + let need_quote = ['\' ',' '[' ']' '(' ')' ' ' '\t' "'" '"' "`"] | any {$in in $value} + if ($need_quote and ($value | path exists)) { + let expanded_path = if ($value starts-with '~') {$value | path expand --no-symlink} else {$value} + $'"($expanded_path | str replace --all "\"" "\\\"")"' + } else {$value} + } } let dark_theme = { -- cgit v1.2.3