2024-04-12 18:19:32 +08:00
|
|
|
#RUN: %fish %s
|
2021-07-03 19:57:21 +08:00
|
|
|
#REQUIRES: command -v tmux
|
|
|
|
|
2021-08-29 15:44:22 +08:00
|
|
|
set -g isolated_tmux_fish_extra_args -C '
|
2024-04-19 17:25:05 +08:00
|
|
|
function fish_prompt
|
|
|
|
printf "prompt $status_generation> <status=$status> <$prompt_var> "
|
|
|
|
set prompt_var ''
|
|
|
|
end
|
2021-07-03 19:57:21 +08:00
|
|
|
function on_prompt_var --on-variable prompt_var
|
|
|
|
commandline -f repaint
|
|
|
|
end
|
2024-04-19 17:25:05 +08:00
|
|
|
function token-info
|
|
|
|
__fish_echo echo "current token is <$(commandline -t)>"
|
|
|
|
end
|
|
|
|
bind ctrl-g token-info
|
2021-07-03 19:57:21 +08:00
|
|
|
'
|
|
|
|
|
2021-09-24 23:07:17 +08:00
|
|
|
isolated-tmux-start
|
2021-09-05 07:54:08 +08:00
|
|
|
|
2021-08-29 15:44:22 +08:00
|
|
|
isolated-tmux capture-pane -p
|
2024-04-19 17:25:05 +08:00
|
|
|
# CHECK: prompt 0> <status=0> <>
|
2021-07-03 19:57:21 +08:00
|
|
|
|
2021-08-29 15:44:22 +08:00
|
|
|
set -q CI && set sleep sleep 10
|
2021-07-03 19:57:21 +08:00
|
|
|
set -U prompt_var changed
|
2021-09-24 23:07:17 +08:00
|
|
|
tmux-sleep
|
2024-04-19 17:25:05 +08:00
|
|
|
isolated-tmux send-keys Enter
|
|
|
|
# CHECK: prompt 0> <status=0> <changed>
|
|
|
|
|
|
|
|
isolated-tmux send-keys echo Space 123
|
|
|
|
tmux-sleep
|
|
|
|
isolated-tmux send-keys C-g
|
|
|
|
|
|
|
|
# CHECK: prompt 0> <status=0> <> echo 123
|
|
|
|
# CHECK: current token is <123>
|
|
|
|
# CHECK: prompt 0> <status=0> <> echo 123
|
|
|
|
tmux-sleep
|
|
|
|
|
2021-08-29 15:44:22 +08:00
|
|
|
isolated-tmux capture-pane -p
|