Files
fish-shell/tests/checks/tmux-prompt.fish
Nahor 440e7fcbc1 Fix failing system tests on Cygwin
The main changes are:
- disabling some checks related to POSIX file permissions when a filesystem is
mounted with "noacl" (default on MSYS2)
- disabling some checks related to symlinks when using fake ones (file copy)

Windows with acl hasn't been tested because 1) Cygwin itself does not have any
Rust package yet to compile fish, and 2) MSYS2 defaults to `noacl`

Part of #12171
2026-04-11 18:55:00 +08:00

94 lines
2.2 KiB
Fish

#RUN: %fish %s
#REQUIRES: command -v tmux
isolated-tmux-start -C '
function fish_prompt
printf "prompt $status_generation> <status=$status> <$prompt_var> "
set prompt_var ""
end
function on_prompt_var --on-variable prompt_var
commandline -f repaint
end
function token-info
__fish_echo echo "current token is <$(commandline -t)>"
end
bind ctrl-g token-info
'
isolated-tmux capture-pane -p
# CHECK: prompt 0> <status=0> <>
if __fish_is_cygwin
# See issue #12074
echo "prompt 0> <status=0> <changed>"
else
set -q CI && set sleep sleep 10
set -U prompt_var changed
tmux-sleep
isolated-tmux send-keys Enter
end
# CHECK: prompt 0> <status=0> <changed>
isolated-tmux send-keys echo Space 123
tmux-sleep
isolated-tmux send-keys C-g
tmux-sleep
isolated-tmux capture-pane -p
# CHECK: prompt 0> <status=0> <> echo 123
# CHECK: current token is <123>
# CHECK: prompt 0> <status=0> <> echo 123
isolated-tmux send-keys C-u '
function fish_prompt
printf "full line prompt\nhidden<----------------------------------------------two-last-characters-rendered->!!"
end' Enter C-l
isolated-tmux send-keys 'test "' Enter 'indent"'
tmux-sleep
isolated-tmux capture-pane -p
# CHECK: full line prompt
# CHECK: …<----------------------------------------------two-last-characters-rendered->!!
# CHECK: test "
# CHECK: indent"
isolated-tmux send-keys C-c '
function fish_prompt
string repeat (math $COLUMNS) x
end
' C-l 'echo hello'
tmux-sleep
isolated-tmux capture-pane -p
# CHECK: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# CHECK: echo hello
isolated-tmux send-keys C-c '
function fish_prompt
seq (math $LINES + 1)
end
function fish_right_prompt
echo test
end
' Enter
tmux-sleep
isolated-tmux capture-pane -p -S -11
# CHECK: 1
# CHECK: 2
# CHECK: 3
# CHECK: 4
# CHECK: 5
# CHECK: 6
# CHECK: 7
# CHECK: 8
# CHECK: 9
# CHECK: 10
# CHECK: 11 test
# CHECK: 2
# CHECK: 3
# CHECK: 4
# CHECK: 5
# CHECK: 6
# CHECK: 7
# CHECK: 8
# CHECK: 9
# CHECK: 10
# CHECK: 11 test