mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-04-19 14:51:13 -03:00
As reported on Gitter, running "echo İ" makes history autosuggestion
for "echo i" crash. This is because history search correctly
returns the former, but string_prefixes_string_case_insensitive("i",
"İ") incorrectly returns false. This is because the prefix check
is implemented by trimming the rhs to the length of the prefix and
checking if the result is equal to the prefix. This is wrong because
the prefix computation should operate on the canonical lowercase
version, because that's what history search uses.
53 lines
1.3 KiB
Fish
53 lines
1.3 KiB
Fish
#RUN: %fish %s
|
|
#REQUIRES: command -v tmux
|
|
|
|
isolated-tmux-start
|
|
isolated-tmux send-keys 'echo "foo bar baz"' Enter C-l
|
|
isolated-tmux send-keys 'echo '
|
|
tmux-sleep
|
|
isolated-tmux send-keys M-Right
|
|
isolated-tmux capture-pane -p
|
|
# CHECK: prompt 1> echo "foo bar baz"
|
|
tmux-sleep
|
|
|
|
touch COMPL
|
|
|
|
# Regression test.
|
|
isolated-tmux send-keys C-u C-l ': sometoken' M-b c
|
|
tmux-sleep
|
|
isolated-tmux capture-pane -p
|
|
# CHECK: prompt 1> : csometoken
|
|
|
|
# Test that we get completion autosuggestions also when the cursor is not at EOL.
|
|
isolated-tmux send-keys C-u 'complete nofilecomp -f' Enter C-l 'nofilecomp ./CO' C-a M-d :
|
|
tmux-sleep
|
|
isolated-tmux capture-pane -p
|
|
# CHECK: prompt 2> : ./COMPL
|
|
|
|
isolated-tmux send-keys C-u C-k C-l ': ./CO'
|
|
tmux-sleep
|
|
isolated-tmux send-keys A C-h
|
|
tmux-sleep
|
|
isolated-tmux capture-pane -p
|
|
# CHECK: prompt 2> : ./COMPL
|
|
|
|
isolated-tmux send-keys C-u 'ech {' Left Left
|
|
tmux-sleep
|
|
isolated-tmux send-keys o C-e C-h 'still alive' Enter
|
|
tmux-sleep
|
|
isolated-tmux capture-pane -p
|
|
# CHECK: prompt {{\d+}}> echo still alive
|
|
# CHECK: still alive
|
|
# CHECK: prompt {{\d+}}>
|
|
|
|
isolated-tmux send-keys C-u 'echo (echo)' Enter
|
|
isolated-tmux send-keys C-l 'echo ('
|
|
tmux-sleep
|
|
isolated-tmux capture-pane -p
|
|
# CHECK: prompt {{\d+}}> echo (echo)
|
|
|
|
isolated-tmux send-keys C-u 'echo İ___' Enter C-l 'echo i'
|
|
tmux-sleep
|
|
isolated-tmux capture-pane -p
|
|
# CHECK: prompt {{\d+}}> echo İ___
|