diff --git a/src/common.rs b/src/common.rs index 3d69408ab..213723ffb 100644 --- a/src/common.rs +++ b/src/common.rs @@ -196,7 +196,7 @@ fn escape_string_script(input: &wstr, flags: EscapeFlags) -> WString { ); let mut need_escape = false; - let mut need_complex_escape = false; + let mut need_complex_escape = no_tilde && input.char_at(0) == '~'; let mut double_quotes = 0; let mut single_quotes = 0; let mut dollars = 0; diff --git a/tests/checks/tmux-complete2.fish b/tests/checks/tmux-complete2.fish new file mode 100644 index 000000000..5ef0ea118 --- /dev/null +++ b/tests/checks/tmux-complete2.fish @@ -0,0 +1,13 @@ +#RUN: %fish %s +#REQUIRES: command -v tmux +#REQUIRES: uname -r | grep -qv Microsoft +# cautiously disable because tmux-complete.fish is disabled +#REQUIRES: test -z "$CI" + +isolated-tmux-start + +isolated-tmux send-keys 'touch ~/"path with spaces"' Enter C-l \ + 'cat ~/space' Tab +tmux-sleep +isolated-tmux capture-pane -p +# CHECK: prompt 1> cat ~/path\ with\ spaces