mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-30 01:11:14 -03:00
Fix replacing completions spuriously quoting ~
Commit29dc30711(Insert some completions with quotes instead of backslashes, 2024-04-13) wrongly copmletes $ cat ~/space to $ cat '~/path with spaces' Today completions can be either replacing or appending. We never quote (but backslash-escape) appending completions (unless they "append" to an empty token). We always quote replacing completions. The assumption in this part of the code is that replacing completions can be quoted without changing meaning. This assumption is wrong for tildes. For the backslash-escaping code path, we take care of this edge case via a special DONT_ESCAPE_TILDES flag. However that flag does not take effect when using quotes for escaping. Fix that. Unfortunately,e97a4fab7(Escape : and = in file completions, 2024-04-19) introduced a (hopefully temporary) code clone in escape_separators, which made added an extra step to debugging here.
This commit is contained in:
13
tests/checks/tmux-complete2.fish
Normal file
13
tests/checks/tmux-complete2.fish
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user