Comment 0 for bug 41082

Revision history for this message
Sebastian Kapfer (caci) wrote : traps overwrite job names

When a DEBUG trap is set, it overwrites the current foreground job's job name (name as seen in the 'jobs' listing).

Reproduction:

1. set trap, e.g. trap echo DEBUG
2. launch foreground process
3. Ctrl+Z to background it
4. type 'jobs'

Example:

sh-3.1$ sleep 600 &
[1] 2870
sh-3.1$ jobs
[1]+ Running sleep 600 &
sh-3.1$ fg
sleep 600

[1]+ Stopped(SIGTSTP) sleep 600
sh-3.1$ trap echo DEBUG
sh-3.1$ fg

sleep 600

[1]+ Stopped(SIGTSTP) sleep 600
sh-3.1$ sleep 600

[2]+ Stopped(SIGTSTP) echo
sh-3.1$ jobs

[1]- Stopped(SIGTSTP) sleep 600
[2]+ Stopped(SIGTSTP) echo
sh-3.1$