GNU bug report logs - #32720
term-mode ignores certain window size changes

Previous Next

Package: emacs;

Reported by: Gary Fredericks <fredericksgary <at> gmail.com>

Date: Wed, 12 Sep 2018 15:24:01 UTC

Severity: minor

Fixed in version 26.2

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: 32720 <at> debbugs.gnu.org
Subject: bug#32720: term-mode ignores certain window size changes
Date: Thu, 13 Sep 2018 10:07:06 +0200
> *Affects*: version 26 (git-bisected to commit 8e7712c7afc)
>
> Note: I have only tried this on --without-x emacs
>
> *Steps to reproduce*
>
>     1. start emacs
>     2. start a term buffer with M-x term
>     3. run `seq 1000` at the bash prompt to fill the screen
>     4. enlarge the terminal window that emacs is running in, so that the
>     window size changes as well
>     5. run `seq 1000` again, and observe that the new space at the bottom of
>     the buffer is not being used
>
> *Analysis notes*
>
> term-mode *does* pick up changes after more explicit window configurations,
> like splits; my workaround for months has been to split and join the
> terminal window whenever I've resized it.
>
> As best I can tell, term-mode subscribes to window size changes by adding
> advice to the window-adjust-process-window-size-function variable, and the
> 8e7712c7afc reduced the set of situations in which that function is called.
>
> I've developed a more automated workaround with a term-load-hook of this
> form:
>
> (add-hook 'window-size-change-functions (lambda (_frame)
> (window--adjust-process-windows)))
>
> It might be that adding this line to the term-mode setup steps would be
> sufficient, but I'm not familiar enough with the window.el code to have a
> guess whether that's actually a good approach.

Emacs no more runs 'window-configuration-change-hook' when the frame
size changes so your workaround should indeed work around that case.
But you should see a similar problem before commit 8e7712c7afc with a
frame containing a window showing process output and that window's
size gets changed.

In its current form, 'window--adjust-process-windows' is a gross hack.
Putting a function by default on 'window-configuration-change-hook'
(or 'window-size-change-functions') is a bad idea IMO.  There should
be no place for such functions in window.el - a special mode should
take care of them.

martin




This bug report was last modified 4 years and 274 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.