fish-shell/tests/checks/tmux-prompt.fish
Johannes Altmanninger 62d8f7277b Revert "Avoid excessive polling of universal variable file"
This reverts commit b56b23007664525e13f7f7ec50a9a6adff0bdfd9.
which somehow made us miss repaints on uvar notifications.

The commit was a workaround for a polling bug which was later properly
fixed by 7c5b8b855 ("Use the uvar notifier pipe timestamp to avoid
excessive polling"), so it's no longer necessary.

Add a system test. If I had a better understanding of the bug I could
probably write a better test.

Fixes #8088
2021-07-03 14:31:37 +02:00

40 lines
862 B
Fish

#RUN: %fish -C 'set -g fish %fish' %s
#REQUIRES: command -v tmux
# Isolated tmux.
set -g tmpdir (mktemp -d)
set -g tmux tmux -S $tmpdir/.tmux-socket -f /dev/null
set -g sleep sleep .1
set -q CI && set sleep sleep 1
set fish (builtin realpath $fish)
cd $tmpdir
while set -e prompt_var
end
$tmux new-session -x 80 -y 10 -d $fish -C '
# This is similar to "tests/interactive.config".
function fish_greeting; end
function fish_prompt; printf "prompt $status_generation> <$prompt_var> "; end
# No autosuggestion from older history.
set fish_history ""
function on_prompt_var --on-variable prompt_var
commandline -f repaint
end
'
$sleep # Let fish draw a prompt.
$tmux capture-pane -p
# CHECK: prompt 0> <>
set -U prompt_var changed
$sleep
$tmux capture-pane -p
# CHECK: prompt 0> <changed>
$tmux kill-server
rm -r $tmpdir