Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

weird behavior with "[un]setopt monitor"



as expected:
 % sleep 30 &
 [1] 47773
 % jobs
 [1]  + running    sleep 30
 % kill %sleep
 [1]  + terminated  sleep 30

somewhat as expected:
 % unsetopt monitor ; sleep 30 & ; setopt monitor
 % jobs
 [1]  + running    sleep 30
 % kill %sleep
 kill: kill %sleep failed: no such process

not at all expected:
 % unsetopt monitor ; sleep 30 & ; setopt monitor
 % jobs
 [1]  + running    sleep 30
 % unsetopt monitor ; kill %sleep
 % jobs
 %

in the first case, i start "sleep 30" in the background. it shows up in the jobs table, and can be killed as expected. no surprised there.

in the second case, i start "sleep 30" in the background after unsetting the monitor option. after the job is dropped into the background, i reset the monitor option. the job is listed in the jobs table, which i didn't expect. as expected, it isn't killed in the normal way.

the third example is where things really get weird. i start "sleep 30" in the background after unsetting the monitor option. after the job is dropped into the background, i reset the monitor option. the job is listed in the jobs table, which i didn't expect. so far, the same as the second example. but if after i unset the monitor option, i can kill the job with kill. not at all what i expected.

is this a bug or an undocumented feature? it seems like an alternate table to store jobs in, which is useful. can i take advantage of this feature? or is it a bug that will be "fixed"?

thanks...


--
        ...atom

 ________________________
 http://atom.smasher.org/
 762A 3B98 A3C3 96C9 C6B7 582A B88D 52E4 D9F5 7808
 -------------------------------------------------

	"I have presented factual data, statistical data, and
	 projected data. Form your own conclusions. Perhaps the
	 NSA has found a polynomial-time (read: fast) factoring
	 algorithm. But we cannot dismiss an otherwise secure
	 cryptosystem due to paranoia. Of course, on the same
	 token, we cannot trust cryptosystems on hearsay or
	 assumptions of security. Bottom line is this: in the
	 field of computer security, it pays to be cautious. But
	 it doesn't pay to be un-informed or needlessly paranoid.
	 Know the facts."
		-- infiNity, The PGP Attack FAQ



Messages sorted by: Reverse Date, Date, Thread, Author