Roland Mainz wrote:
> I hit another bug related to SIGTTOU when an editor like /usr/bin/vi or
> /usr/bin/vim is accidently launched as background process via $ vi file
> & #.
> 
> Steps to reproduce (for ast-ksh.2009-06-22):
> 1. Start ksh93 with "gmacs" editor mode
> $ ksh93 -o gmacs
> 2. Start "vi" as _background_ process like this:
> $ vi mytestfile.txt &
> (Process gets stopped with SIGTTOU)
> 3. Get "vi" process in the foreground:
> $ fg
> 4. Quit "vi" via "!:q"
> 
> Result:
> ksh93's input mode only prints "> " for every key pressed. Somehow it
> seems the shell doesn't reset the editor mode state after "vi" quits...
> ;-(

It seems Solaris /usr/bin/stty can be used to undo the damage. Below is
the diff of the "stty" output between a normal dtterm/xterm session
("xworking") and after the shell enteres the "> " mode ("xnotworking"):
-- snip --
--- xworking    Thu Aug 13 09:56:59 2009
+++ xnotworking Thu Aug 13 09:57:17 2009
@@ -1,5 +1,6 @@
 speed 9600 baud; -parity 
 rows = 24; columns = 162; ypixels = 466; xpixels = 1144;
-erase = ^h; swtch = <undef>; 
-brkint -inpck -istrip icrnl -ixany ixoff onlcr tab3 
-echo echoe echok echoctl echoke iexten 
+min = 1; time = 0;
+erase = ^h; eof = ^a; swtch = <undef>; dsusp = <undef>; rprnt =
<undef>; flush = <undef>; werase = <undef>; lnext = <undef>; 
+brkint -inpck -istrip -ixany ixoff onlcr tab3 
+-icanon -echo echoe -echok echoctl echoke iexten
-- snip --

Or different view (one properly per line (but a bit garbled)):
-- snip --
$ diff -u <( cat xworking | tr ' ' $'\n' | sort -u ) <( cat xnotworking
| tr ' ' $'\n' | sort -u )                                           
--- /dev/fd/4   Thu Aug 13 10:05:11 2009
+++ /dev/fd/5   Thu Aug 13 10:05:11 2009
@@ -1,32 +1,43 @@
 
 =
+0;
+1;
 1144;
 162;
 24;
 466;
 9600
+^a;
 baud;
 brkint
 columns
-echo
+dsusp
+-echo
 echoctl
 echoe
-echok
+-echok
 echoke
+eof
 erase
+flush
 ^h;
-icrnl
+-icanon
 iexten
 -inpck
 -istrip
 -ixany
 ixoff
+lnext
+min
 onlcr
 -parity
 rows
+rprnt
 speed
 swtch
 tab3
+time
 <undef>;
+werase
 xpixels
 ypixels
-- snip --

Just setting "stty echo" seems to be a basic cure for the problem...
... question is... is this the right thing to do in this case (I don't
know much about this part of the terminal stuff) ?

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-users mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-users

Reply via email to