I'm having this problem; my TclTk does not exit cleanly when I run
it in background.
I obtain this message: [4] + Stopped (tty output) Client.tcl
Although, I don't understand why it does this, my exit button has this
command:
button .map.info.exit -text "EXIT" -command {puts "OK"; flush stdout ;
destroy .; exit} \
-font medfont -fg red -bg bisque -relief raised\
-activebackground green
The "OK" does come out followed by the Stopped tty message. So I
wonder what is exactly the
"tty" is choking on.
The client is standalone (although it can hook up to other clients via
socket, however, I get this
error even if it doesn't hook up to anything) and is not piped into
anything.
Any ideas on why this occurs?
Thanks in advance,
Stuart
Oh, I'm running this app under Solaris using the BLT extension within
the cshell
The output of stty is:
stuart @ akala % stty
speed 38400 baud; -parity
rows = 24; columns = 113; ypixels = 0; xpixels = 0;
eol = -^?; eol2 = -^?; swtch = <undef>;
brkint -inpck -istrip icrnl imaxbel onlcr tab3
echo echoe echok echoctl echoke iexten
Stuart
Hmm, indeed seeing the OK is weird. Under these circumstances I'd
expect it not to appear, since the write() generated the signal...
Maybe we could proceed with an strace. For this, assuming your outer
shell is csh:
strace -o tra -f -tt csh
% client.tcl &
Stopped (tty output) Client.tcl
% exit
Please send me the 'tra' file by e-mail.
-Alex
It looks like I goofed, the "OK" didn't come out. I guess
I ran it in the foreground.. but I cudda sworn I ran it in background.
Either way, its still a nuisance.
I've tried that strace, but it didn't seem to do anything.
Stuart
There's no mystery, then. When the terminal has the proper setting
(stty tostop), a background process is not allowed to write to the
terminal.
If you want to disable this behavior (which may or may not be the
default depending on the local setup), use 'stty -tostop'. You might
want to do this in your .cshrc or equivalent.
-Alex
redirect stdin, stdout, stderr
uwe