Comment 4 for bug 1566437

Revision history for this message
Egmont Koblinger (egmont-gmail) wrote :

> The terminal shouldn't rely on applications exiting cleanly.

You misunderstand the very basics of terminals.

A terminals just obeys the instructions it receives in a single stream, it doesn't even have the notion of "shell", "application" (started from that shell), "exit" (of that shell), "clean" vs. "unclean" exit, etc. It cannot tell which instruction comes from which component.

The best you can do is modify your shell prompt: add escape sequences that restore as many properties as you wish to their default. E.g. leave alternate screen, disable mouse, restore charset, restore color and so on.

You might want to file another bugreport so that the distribution's default PS1 shell prompt takes care of this.

Re (3): It's an intentional feature that in alternate screen mode, if the application running inside the terminal is not interested in mouse events, mouse scroll events are converted to Up/Down keystrokes.