[BRLTTY] Linux console hacking (was: Re: Footsteps towards better accessibility in Linux)

Samuel Thibault samuel.thibault at ens-lyon.org
Sun Oct 4 14:09:44 UTC 2026


Hello,

We have investigated the alternative screen spurious speech question.
Putting some quotes below for reminding the context:

Nicolas Pitre, le lun. 30 mars 2026 10:10:25 -0400, a ecrit:
> On Sun, 29 Mar 2026, Sébastien Hinderer wrote:
> > Nicolas Pitre (2026/03/28 20:41 -0400):
> > > The alternate screen is not cleared "at program exit". It doesn't know
> > > if a program exited or not.
> > >
> > > What happens here is:
> > >
> > > - When the sequence "\e[?1049h" is sent to the terminal, the alternate
> > >   screen is activated. It is always blank upon activation.
> > >
> > > - When "\e[?1049l" is sent to the terminal, the normal screen is
> > >   restored i.e. you'll end up with the same screen content that existed
> > >   at the moment "\e[?1049h" was sent and the alternate screen with its
> > >   content is discarded.
> > >
> > > You can even play with this using echo -e at the shell prompt.
> > > Really there isn't more to it than that.
> > 
> > Okay thanks for having explained the mechanism. However I continue to
> > observe that when an application knows how to use the alternative
> > screen, then right after the switch to the alternatvie screen BRLTTY
> > pornounces unrelated content, as if there were some leftover of a
> > previous session under the alternative screeen.
> 
> Does the braille display contain unrelated content too, even if only for 
> a fraction of a second?

Sébastien told me that he didn't see the unreleated content on the
Braille display, but I'm thinking that perhaps it's really too fast for
the dots to have time to raise.

I have had a look at enter_alt_screen, it uses csi_J(CSI_J_FULL) to
clear the screen. I see in csi_J that it first calls flush_scrollback
and then only calls scr_memsetw. Thus flush_scrollback happens to move
the cursor, before the screen is cleared. I guess that what happens is
that this cursor move makes brltty have the time to read the top of the
screen before it is cleared.

Samuel


More information about the BRLTTY mailing list