Bug#949139: xterm: ls --color with errors piped to less sometimes corrupts the xterm status (split escape sequences)
- To: dickey@his.com, 949139@bugs.debian.org
- Cc: Milan Kupcevic <milan@debian.org>
- Subject: Bug#949139: xterm: ls --color with errors piped to less sometimes corrupts the xterm status (split escape sequences)
- From: Vincent Lefevre <vincent@vinc17.net>
- Date: Mon, 14 Feb 2022 17:41:01 +0100
- Message-id: <[🔎] 20220214164101.GB30229@cventin.lip.ens-lyon.fr>
- Reply-to: Vincent Lefevre <vincent@vinc17.net>, 949139@bugs.debian.org
- In-reply-to: <20200131022103.qjlcpxrstkmhdfwc@prl-debianold-64.jexium-island.net>
- References: <20200117110157.GF17246@zira.vinc17.org> <20200117105528.GA1507780@zira.vinc17.org> <20200117221248.6rsf3kc6lzj4ln7f@prl-debianold-64.jexium-island.net> <20200117224520.GH17246@zira.vinc17.org> <20200117230246.GI17246@zira.vinc17.org> <20200117105528.GA1507780@zira.vinc17.org> <20200117232634.GK17246@zira.vinc17.org> <20200131011130.nob56ulkyytet6um@prl-debianold-64.jexium-island.net> <20200117105528.GA1507780@zira.vinc17.org> <20200131022103.qjlcpxrstkmhdfwc@prl-debianold-64.jexium-island.net> <20200117105528.GA1507780@zira.vinc17.org>
Control: reassign -1 less
Control: found -1 487-0.1
Control: found -1 590-1
Control: retitle -1 less: with option -R, the escape sequences should be sent in an atomic way so that they are not broken by stderr
Control: tags -1 upstream - wontfix
On 2020-01-30 21:21:03 -0500, Thomas Dickey wrote:
> So... (see my previous message), there's no way for xterm (or any terminal)
> to distinguish your shell's stdout from stderr. There's only the usual
> solution, which assumes that applications which spit out both will do
> fflush's to keep the two in sync.
Indeed. Reassigning to less, which knows about the valid escape
sequences when option -R is used, so that it could ensure that
they are sent in an atomic way. The problem would still exist
with -r, but this option is already strongly discouraged.
--
Vincent Lefèvre <vincent@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)
Reply to: