GNU bug report logs - #66128
28.2; visible-bell breaks setterm --inversescreen on

Previous Next

Package: emacs;

Reported by: tom <at> logand.com

Date: Wed, 20 Sep 2023 20:16:01 UTC

Severity: normal

Found in version 28.2

Full log


View this message in rfc822 format

From: Thomas Dickey <dickey <at> his.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 66128 <at> debbugs.gnu.org, Thomas Dickey <dickey <at> his.com>, Tomas Hlavaty <tom <at> logand.com>
Subject: bug#66128: 28.2; visible-bell breaks setterm --inversescreen on
Date: Sun, 24 Sep 2023 20:07:03 -0400
[Message part 1 (text/plain, inline)]
On Sat, Sep 23, 2023 at 08:38:53AM +0300, Eli Zaretskii wrote:
> > From: Tomas Hlavaty <tom <at> logand.com>
> > Cc: 66128 <at> debbugs.gnu.org
> > Date: Fri, 22 Sep 2023 22:18:14 +0200
> > 
> > On Thu 21 Sep 2023 at 08:00, Eli Zaretskii <eliz <at> gnu.org> wrote:
> > > Emacs just sends to the terminal the sequence defined by the "vb"
> > > termcap capability.  Is that not correct when the screen colors are
> > > inverted?
> > 
> > I do not know.
> > 
> > > Is this perhaps the problem of the terminal?
> > 
> > No, I get the same behaviour in xfce4-terminal and kitty, so this does
> > not seem to be specific problem with the linux console.
> > 
> > I think I wrote it in the bug report too, under an X based terminal:
> > 
> >    $ emacs -nw -Q --eval '(setq visible-bell t)'
> > 
> > then press PgUp.
> > 
> > > Btw, we always use the termcap's "vb", even when terminfo is
> > > available; should we use the terminfo's "flash" instead?
> > 
> > I do not know.
> 
> Thomas, could you perhaps help us out here?  This is about sending the
> "visible bell" sequence to a terminal after "setterm --inversescreen on".
> The original report is:
> 
>     $ setterm --inversescreen on

setterm doesn't have any special way of manipulating the terminal -
it uses the same escape sequences that emacs would

>     $ emacs -Q --eval '(setq visible-bell t)'
> 
>   Then in Emacs do something that causes a bell, like try moving beyond
>   the buffer's end.  This causes the Emacs background to become white,
>   i.e. the visible-bell somehow countermands the inversescreen state.
> 
> Can you think of any reason for this behavior?  Do terminals honor

https://github.com/util-linux/util-linux/blob/master/term-utils/setterm.c

https://github.com/util-linux/util-linux/blob/1e0ad14b3ac08d855cda6de346a65f9b834e00db/term-utils/setterm.c#L1005

	/* -inversescreen [on|off]. */
	if (ctl->opt_inversescreen)
		fputs(ctl->opt_invsc_on ? "\033[?5h" : "\033[?5l", stdout);

man console_codes

       ESC [ ? 5 h
              DECSCNM (default off): Set reverse-video mode.

but visual-bell can be the same thing

The "vb" termcap capability is found with "man 5 terminfo"

          flash_screen                flash     vb     visible bell (may
                                                       not move cursor)

to be "flash" in terminfo,
and "infocmp linux" shows

	flash=\E[?5h$<200/>\E[?5l,

which is to say,
	turn reverse-video on
	wait 200 milliseconds
	turn reverse-video off

> inversescreen when they perform the visible-bell function?  Emacs just
> sends the sequence reported by the "vb" termcap capability of the
> terminal when the visible-bell is triggered.
> 
> Thanks.

-- 
Thomas E. Dickey <dickey <at> invisible-island.net>
https://invisible-island.net
[signature.asc (application/pgp-signature, inline)]

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

Previous Next


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