zsh-users
 help / color / mirror / code / Atom feed
* weird behavior with "[un]setopt monitor"
@ 2009-03-14  8:34 Atom Smasher
  2009-03-14 16:56 ` Bart Schaefer
  0 siblings, 1 reply; 3+ messages in thread
From: Atom Smasher @ 2009-03-14  8:34 UTC (permalink / raw)
  To: zsh-users

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-03-14 18:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-14  8:34 weird behavior with "[un]setopt monitor" Atom Smasher
2009-03-14 16:56 ` Bart Schaefer
2009-03-14 18:22   ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).