GNU bug report logs - #66678
30.0.50; Tabs close erratically in text terminal

Previous Next

Package: emacs;

Reported by: Petteri Hintsanen <petterih <at> iki.fi>

Date: Sun, 22 Oct 2023 11:23:01 UTC

Severity: normal

Found in version 30.0.50

Fixed in version 29.1.90

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 66678 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Petteri Hintsanen <petterih <at> iki.fi>, Juri Linkov <juri <at> linkov.net>
Cc: 66678 <at> debbugs.gnu.org
Subject: Re: bug#66678: 30.0.50; Tabs close erratically in text terminal
Date: Sun, 22 Oct 2023 15:17:23 +0300
> From: Petteri Hintsanen <petterih <at> iki.fi>
> Date: Sun, 22 Oct 2023 14:21:16 +0300
> 
> I'm running Emacs in xterm with xterm-mouse-mode and tab-bar-mode
> enabled.  There, tabs have an "x" mark for closing them.  However, tabs
> will also close if you click on the character position right after the
> buffer name in the tab.  This makes it easy to unintentionally close a
> tab instead of switching to it, which is very annoying.
> 
> Recipe:
> 
> - In xterm, start emacs by `emacs -Q -nw'.
> - M-x xterm-mouse-mode
> - M-x tab-bar-mode
> - Create a new tab by clicking on "+" on the tab bar.
>   Now you should have two tabs named `*scratch*'
> - Click on the first (leftmost) tab right after the second asterisk.
> 
> Expected behavior: Leftmost tab is selected.
> Actual behavior: Leftmost tab is closed.

This is not specific to xterm or xterm-mouse, it happens with any
mouse-equipped text-mode terminal.  It happens in Emacs 29 as well.

> I traced the issue to `tab-bar-auto-width' function which — I think — is
> used to pad a tab text with spaces to make it have a uniform width
> within the tab bar.  The function erroneously copies 'close-tab text
> property from the close button text (tab-bar-close-button) and positions
> it right after the buffer name, causing the said behavior.
> 
> The attached patch fixes the immediate issue, but I doubt if it is
> sufficient, given that there is similar close tab-related logic elsewhere
> in the code.  Another workaround is to set `tab-bar-close-button' to one
> character string "x" instead of " x".

Juri, please install the fix you think is appropriate on the emacs-29
branch, since the problem exists there as well.

Thanks.




This bug report was last modified 1 year and 264 days ago.

Previous Next


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