all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "K. Jansma" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 41420@debbugs.gnu.org
Subject: bug#41420: 26.3; Terminal to 9 columns if other buffer killed (emacs daemon)
Date: Wed, 20 May 2020 14:53:33 +0000 (UTC)	[thread overview]
Message-ID: <1688899779.231131.1589986413844@mail.yahoo.com> (raw)
In-Reply-To: 1688899779.231131.1589986413844.ref@mail.yahoo.com

When using Emacs with e.g. EXWM, it may happen that a terminal buffer resets the number of columns to 9 if another buffer is killed.
This is not an issue with EXWM, as the following reproduction scenarios shows:

1.    Go to an unused tty and run "emacs --fg-daemon -Q"

2.    go to another tty and run "emacsclient -c"

3.    Make sure the current frame has only one window C-x 0

4.    open terminal buffer M-x ansi-term

5.    switch to *scratch* C-x b *scratch* (since there is only one window, the terminal will now be hidden)

6.    kill the scratch buffer C-x k *scratch*

7.    You will see the terminal buffer again, but it wrapped all lines to 9 columns max, despite the buffer covering the whole frame (there are no other windows) and there is no user-friendly (AFAIK) way to reset it to use the full buffer width

When not running Emacs as daemon, this does not happen.

Note that some users suggest never killing *scratch*, but AFAIK this is the only reliable way I'm currently aware of, to reproduce this issue. Under normal usage circumstances, it is not limited to killing *scratch*...


Another user who helped out in reproducing this issue [1] writes:

"When you run Emacs as a daemon it creates a hidden frame, and by default that frame will be 'displaying' the *scratch* buffer. (In a non-default invocation, it might be displaying something else.) When you kill the buffer which was displayed by the hidden frame, it means the hidden frame is now displaying something else. If that something else is your terminal buffer (probably the case if that was the most recent other buffer used) then you run headlong into the problem I described earlier.

Please M-x report-emacs-bug and include all the details I've mentioned here. I think the hidden frame created by the daemon should be displaying a special-purpose hidden buffer, so that you can't (easily) accidentally cause that frame to display anything else. Or perhaps killing any buffer displayed in the hidden frame could cause Emacs to immediately create a new hidden buffer to display in its place. Or if it's workable, a way to have that frame displaying no buffers at all might be cleaner.

term.el can probably work around this, but I think the source of the issue is so obscure that it makes all kinds of sense to address it generally, so that similar issues aren't caused for other libraries."


References:
[1] https://www.reddit.com/r/emacs/comments/gm1d8y/please_help_me_fix_this_bug_with_terminal_buffers/





       reply	other threads:[~2020-05-20 14:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1688899779.231131.1589986413844.ref@mail.yahoo.com>
2020-05-20 14:53 ` K. Jansma via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-06-06 13:52   ` bug#41420: 26.3; Terminal to 9 columns if other buffer killed (emacs daemon) Lars Ingebrigtsen
2022-07-05 11:45     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1688899779.231131.1589986413844@mail.yahoo.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=41420@debbugs.gnu.org \
    --cc=k_jansma@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.