fish-shell/tests/checks/job-ids.fish
Johannes Altmanninger 8bf8b10f68 Extended & human-friendly keys
See the changelog additions for user-visible changes.

Since we enable/disable terminal protocols whenever we pass terminal ownership,
tests can no longer run in parallel on the same terminal.

For the same reason, readline shortcuts in the gdb REPL will not work anymore.
As a remedy, use gdbserver, or lobby for CSI u support in libreadline.

Add sleep to some tests, otherwise they fall (both in CI and locally).

There are two weird failures on FreeBSD remaining, disable them for now
https://github.com/fish-shell/fish-shell/pull/10359/checks?check_run_id=23330096362

Design and implementation borrows heavily from Kakoune.

In future, we should try to implement more of the kitty progressive
enhancements.

Closes #10359
2024-04-02 14:35:16 +02:00

55 lines
1,003 B
Fish

# RUN: %fish %s | %filter-ctrlseqs
# Ensure that job IDs are sequential.
status job-control full
set -g tokill
function func100
sleep 100 &
set -g tokill $tokill $last_pid
end
func100
# The redirection ensures this becomes a real job.
begin
sleep 200 &
set -g tokill $tokill $last_pid
end </dev/null
sleep 300 &
set -g tokill $tokill $last_pid
jobs
#CHECK: Job Group{{.*}}
#CHECK: 3{{.*\t}}sleep 300 &
#CHECK: 2{{.*\t}}sleep 200 &
#CHECK: 1{{.*\t}}sleep 100 &
# Kill job 2; the next job should have job ID 4 because 3 is still in use (#6053).
status job-control interactive
command kill -9 $tokill[2]
# Wait for the job to die - the signal needs to be delivered.
wait $tokill[2] 2>/dev/null
set -e tokill[2]
status job-control full
sleep 400 &
set -g tokill $tokill $last_pid
jobs
#CHECK: Job Group{{.*}}
#CHECK: 4{{.*\t}}sleep 400 &
#CHECK: 3{{.*\t}}sleep 300 &
#CHECK: 1{{.*\t}}sleep 100 &
status job-control interactive
for pid in $tokill
command kill -9 $pid
end