fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Johannes Altmanningertest/tmux-job: fix intermittent failure77a946633

master
1.2 KiB43 linesraw
1#RUN: fish=%fish %fish %s
2#REQUIRES: command -v tmux
3
4isolated-tmux-start
5
6isolated-tmux send-keys \
7    "sleep 0.5 &" Enter
8sleep 0.1
9isolated-tmux send-keys \
10    "echo hello"
11sleep 0.6
12isolated-tmux send-keys Space world
13sleep 0.1
14isolated-tmux capture-pane -p
15# CHECK: prompt 0> sleep 0.5 &
16# CHECK: prompt 0> echo hello
17# CHECK: fish: Job 1, 'sleep 0.5 &' has ended
18# (I've seen this print " world", I guess it depends on tmux version and how big it thinks the terminal is)
19# CHECK: {{.*}} world
20
21isolated-tmux send-keys C-u C-l "sleep 1 | cat &" Enter "bg %1" Enter
22tmux-sleep
23isolated-tmux capture-pane -p | string match '*to background*'
24# CHECK: Send job 1 'sleep 1 | cat &' to background
25
26sleep 1.5
27
28isolated-tmux send-keys C-l '
29    status job-control full
30    for x in (seq 10)
31        sleep 0.0001 &
32        fg
33    end
34'
35tmux-sleep
36isolated-tmux capture-pane -p |
37    string match -rv '^fg: There are no suitable jobs' |
38    string match -rv '^killpg\(\d+, SIGCONT\): No such process$' |
39    string match -rv '^Send job \d+ \(sleep 0.0001 &\) to foreground$' |
40    string match -rv '^warning: Could not send job \d+ \(\'sleep 0.0001 &\'\) with pgid \d+ to foreground' |
41    string match -rv '^tcsetpgrp: No such process'
42
43# CHECK: prompt 3>