From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#66128: 28.2; visible-bell breaks setterm --inversescreen on Date: Mon, 25 Sep 2023 08:03:38 +0300 Message-ID: <83edim3kut.fsf@gnu.org> References: <87zg1gk3eu.fsf@neko.mail-host-address-is-not-set> <83sf789l3w.fsf@gnu.org> <87h6nmvu61.fsf@neko.mail-host-address-is-not-set> <83cyy95tzm.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21232"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66128@debbugs.gnu.org, tom@logand.com To: dickey@his.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 25 07:05:18 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qkdmY-0005IL-AM for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Sep 2023 07:05:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qkdm8-0002I9-8z; Mon, 25 Sep 2023 01:04:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkdm6-0002Hg-Ef for bug-gnu-emacs@gnu.org; Mon, 25 Sep 2023 01:04:50 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qkdm6-0005j5-5J for bug-gnu-emacs@gnu.org; Mon, 25 Sep 2023 01:04:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qkdmI-0001C1-0Y for bug-gnu-emacs@gnu.org; Mon, 25 Sep 2023 01:05:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 25 Sep 2023 05:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66128 X-GNU-PR-Package: emacs Original-Received: via spool by 66128-submit@debbugs.gnu.org id=B66128.16956182704535 (code B ref 66128); Mon, 25 Sep 2023 05:05:01 +0000 Original-Received: (at 66128) by debbugs.gnu.org; 25 Sep 2023 05:04:30 +0000 Original-Received: from localhost ([127.0.0.1]:43906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkdll-0001B4-HB for submit@debbugs.gnu.org; Mon, 25 Sep 2023 01:04:29 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qkdlj-0001Ap-IV for 66128@debbugs.gnu.org; Mon, 25 Sep 2023 01:04:28 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qkdlR-0005eG-JO; Mon, 25 Sep 2023 01:04:09 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=DNGyI18geGqD39ehQ+7fTW4jOXv7WdJqdInQifnGnjo=; b=CK2xcjBWzire IqTlVVyvRS4u52yBG2eyUJD+7eSr7uc9yAsvvxUBgLlrZa0AlN9ot6RpMtcw73kmvFox99+3mfbFO dHAyDEfEbipqPdQFgBEy+o8+1Juc056w+ume6bnLDr5TJGXLch9WCCg9sVWDgKOzKvsh/AS7ZbEOL 0IPuOCXtGI/JMCjX42Ghyp9gnbp1Zsq35kreoQdpMJzVhutNIsu/ARy7o2G7T19XNjyxVKafSBwuU UX7qMZLTts2x6ZBC353Se6mYiYaKbYW3L9zO+1ObWU5NYxCamLFpHREJiWqfieG7L75q6aWeA6KM9 uaFWDWX1H+9ooOA5Bs0KgA==; In-Reply-To: (message from Thomas Dickey on Sun, 24 Sep 2023 20:07:03 -0400) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:271293 Archived-At: > Date: Sun, 24 Sep 2023 20:07:03 -0400 > From: Thomas Dickey > Cc: Tomas Hlavaty , Thomas Dickey , > 66128@debbugs.gnu.org > > 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 Thanks. So Emacs should ideally reverse the sequence when the terminal is in the reverse-video mode, or at least send the "\033[?5h" sequence after sending "flash"? But can Emacs know that the terminal is in this mode at startup?