From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: misbehavior in shell window with ksh Date: Thu, 04 May 2017 17:42:59 +0300 Message-ID: <8337ckhedo.fsf@gnu.org> References: <12812.1493593946@alto> <83o9vdjcl6.fsf@gnu.org> <87pofszvue.fsf@rosalinde> <837f20ke4g.fsf@gnu.org> <87inlkzlkt.fsf@rosalinde> <831ss8k40f.fsf@gnu.org> <87bmrczi9s.fsf@rosalinde> <83h913iq9x.fsf@gnu.org> <87efw7jv1b.fsf@rosalinde> <83fugni5i8.fsf@gnu.org> <8760hjjj16.fsf@rosalinde> <83fuglhlqk.fsf@gnu.org> <87k25xawgg.fsf@rosalinde> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1493909032 17333 195.159.176.226 (4 May 2017 14:43:52 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 4 May 2017 14:43:52 +0000 (UTC) Cc: emacs-devel@gnu.org, mkupfer@alum.berkeley.edu To: Stephen Berman Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu May 04 16:43:48 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d6Hyt-0004Ni-DR for ged-emacs-devel@m.gmane.org; Thu, 04 May 2017 16:43:47 +0200 Original-Received: from localhost ([::1]:42354 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6Hyz-0000GJ-2A for ged-emacs-devel@m.gmane.org; Thu, 04 May 2017 10:43:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43382) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6HyT-0000GC-L8 for emacs-devel@gnu.org; Thu, 04 May 2017 10:43:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d6HyQ-0002L0-H8 for emacs-devel@gnu.org; Thu, 04 May 2017 10:43:21 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d6HyQ-0002Ku-DN; Thu, 04 May 2017 10:43:18 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1497 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1d6HyP-000773-RI; Thu, 04 May 2017 10:43:18 -0400 In-reply-to: <87k25xawgg.fsf@rosalinde> (message from Stephen Berman on Thu, 04 May 2017 09:54:23 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:214566 Archived-At: > From: Stephen Berman > Cc: mkupfer@alum.berkeley.edu, emacs-devel@gnu.org > Date: Thu, 04 May 2017 09:54:23 +0200 > > > The above is the interesting part: it shows that the "> " string was > > received from the shell subprocess. And that rings a bell: we have > > this window-adjust-process-window-size-function feature, which is new > > in Emacs 25. It sends a TIOCSWINSZ or TIOCSSIZE ioctl to the shell's > > pty; perhaps that causes the shell to respond with PS2? Can you play > > with the value of this variable, like set it to a function that > > returns nil, so that set-process-window-size is not called, and see if > > that helps to avoid the issue? > > Bingo! That variable is a user option and when I change its value with > M-x customize-option to "Do not adjust process window sizes" (i.e. the > function `ignore') and then execute the recipe, "> " is not inserted. > When I return to the customization buffer and change the value back to > the default "Minimum area of any window" (i.e. the function > `window-adjust-process-window-size-smallest') and then switch back to > the *shell* buffer, "> " I see that has now been inserted. Thanks for looking into this. Can the shell experts among us please tell whether this is an expected reaction of a shell to window-resizing ioctl? And why this is only seen with ksh? And why in some cases one needs to set EDITOR in the environment? IOW, the window-adjust-process-window-size-function is a standard feature that is turned on by default; if it turns out that it has annoying unintended consequences in some use cases, we will have to rethink when we turn it on and off, IMO.