fork/fish-shell

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

Johannes Altmanningertests: filter control sequences only when interactive1e858eae3

master
984 B55 linesraw
1# RUN: %fish %s
2
3# Ensure that job IDs are sequential.
4
5status job-control full
6
7set -g tokill
8
9function func100
10    sleep 100 &
11    set -g tokill $tokill $last_pid
12end
13func100
14
15# The redirection ensures this becomes a real job.
16begin
17    sleep 200 &
18    set -g tokill $tokill $last_pid
19end </dev/null
20
21
22sleep 300 &
23set -g tokill $tokill $last_pid
24
25jobs
26
27#CHECK: Job	Group{{.*}}
28#CHECK: 3{{.*\t}}sleep 300 &
29#CHECK: 2{{.*\t}}sleep 200 &
30#CHECK: 1{{.*\t}}sleep 100 &
31
32# Kill job 2; the next job should have job ID 4 because 3 is still in use (#6053).
33
34status job-control interactive
35command kill -9 $tokill[2]
36# Wait for the job to die - the signal needs to be delivered.
37wait $tokill[2] 2>/dev/null
38set -e tokill[2]
39status job-control full
40sleep 400 &
41set -g tokill $tokill $last_pid
42
43jobs
44
45#CHECK: Job	Group{{.*}}
46#CHECK: 4{{.*\t}}sleep 400 &
47#CHECK: 3{{.*\t}}sleep 300 &
48#CHECK: 1{{.*\t}}sleep 100 &
49
50
51status job-control interactive
52
53for pid in $tokill
54    command kill -9 $pid
55end