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

Nicolas Pitre nico at fluxnic.net
Sun Mar 29 00:41:19 UTC 2026


On Sat, 28 Mar 2026, Sébastien Hinderer wrote:

> PS: I'm observing something strange though.
> 
> Context: I use BRLTTY with speech synthesis enabled.
> 
> Sometimes (sorry I cannot be more precise here) when I run mutt,
> the speech synthesis reads an index entry from a mailbox I did display
> but that is currently not displayed.
> 
> Could it be that the laternative screen is not cleared at program exit
> whereas it should?

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.

> If so, is the program that should clear the screen or should that be 
> done by the kernel? I tend to think it should be done by the kernel to 
> not depend on the program to ensure there is no leftover?

In the context of the above I don't think this matters.


Nicolas


More information about the BRLTTY mailing list