zsh-workers
 help / color / mirror / code / Atom feed
* 3.1.6 issues with command-line wiping
@ 1999-10-05 18:44 Clint Olsen
  1999-10-06 17:04 ` PATCH: 3.0.6/3.1.6: " Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: Clint Olsen @ 1999-10-05 18:44 UTC (permalink / raw)
  To: zsh-workers

On AIX 4.1, I'm having the following problems.  I'm in less, and I want to
do something back in the shell.  I ctrl-z to get out, and I type a command.
About half-way through the command the line wipes out (like the shell
thought the line wrapped before it was supposed to).  Command-line
completion works below the command-line as expected.  I seem to have to
type a manual "resize" to get things working again.

The symptoms seem to be that if I'm in less, and I resize the window for a
better view of a wide file, ctrl-z-ing back to the shell doesn't seem to
get the lines/columns set properly.  I've never had this problem with older
versions of Zsh.  Any ideas?

-Clint


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

* PATCH: 3.0.6/3.1.6: Re: 3.1.6 issues with command-line wiping
  1999-10-05 18:44 3.1.6 issues with command-line wiping Clint Olsen
@ 1999-10-06 17:04 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 1999-10-06 17:04 UTC (permalink / raw)
  To: Clint Olsen, zsh-workers

On Oct 5, 11:44am, Clint Olsen wrote:
} Subject: 3.1.6 issues with command-line wiping
}
} The symptoms seem to be that if I'm in less, and I resize the window for a
} better view of a wide file, ctrl-z-ing back to the shell doesn't seem to
} get the lines/columns set properly.

This came about somehow in the cumulative procoess-group-handling rewrites
that were done over the last few weeks before 3.1.6/3.0.6 were released.
The following fixes it for me, but I'm only 95% sure it isn't going to
break something else ... I don't *think* it's possible to reach the second
hunk with `somestopped' set unless the entire job has been stopped, and I
don't know any reason not to set `inforeground' correctly for a suspended
job; but I could be wrong about those and I wonder about setting `lastval2'
and `lastval'.

After this patch, $? is 20 after suspending a job, which disagrees with
bash; I don't have a ksh to test against.  This means, for example, that

	less /etc/termcap || echo failed

prints "failed" immediately upon hitting ^Z.  This could be changed by
restoring the `else' and copying the code that sets `inforeground' into
the `if (somestopped)' branch (above the first hunk of my patch).

I've tested the patch by resizing xterm and then suspending or interrupting
during each of

	less /etc/termcap
	cat /etc/termcap | while read line; do less; done
	cat /etc/termcap | while read line; do echo $line; done

and it appears to work, but please play with it yourselves and report any
oddness.

(The patch is against 3.0.6, so expect an offset when patching 3.1.6.)

Index: Src/jobs.c
===================================================================
@@ -236,7 +236,8 @@
 	    }
 	    return;
 	}
-    } else {                   /* job is done, so remember return value */
+    }
+    {                   /* job is done or stopped, remember return value */
 	lastval2 = val;
 	/* If last process was run in the current shell, keep old status
 	 * and let it handle its own traps, but always allow the test
@@ -261,7 +262,7 @@
 	if (mypgrp != pgrp && inforeground &&
 	    (jn->gleader == pgrp || (pgrp > 1 && kill(-pgrp, 0) == -1))) {
 	    if (list_pipe) {
-		if (pgrp > 1 && kill(-pgrp, 0) == -1) {
+		if (somestopped || (pgrp > 1 && kill(-pgrp, 0) == -1)) {
 		    attachtty(mypgrp);
 		    /* check window size and adjust if necessary */
 		    adjustwinsize(0);

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

end of thread, other threads:[~1999-10-06 17:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-05 18:44 3.1.6 issues with command-line wiping Clint Olsen
1999-10-06 17:04 ` PATCH: 3.0.6/3.1.6: " Bart Schaefer

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).