terminal-util: don't issue "ESC c" sequence on reset, but only when erasing the screen
authorLennart Poettering <lennart@poettering.net>
Thu, 11 Jul 2024 07:34:11 +0000 (09:34 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 19 Jul 2024 09:41:43 +0000 (11:41 +0200)
commit841eb9c186816acfef8f3f724647a7f0649f214d
tree854881e49d9f81b156c189dcbd8f8543f2320f53
parentcfac09083b287c713a2bc3724eb71468a350321d
terminal-util: don't issue "ESC c" sequence on reset, but only when erasing the screen

ESC c is a (vaguely defined) "reset to initial state" ANSI sequence.
Many terminals clear the screen in this case, but that's a bit drastic I
think for most resets.

ESC c was added to the reset logic in
00bc83a275fa3ca8d90579fe9597d8b651d47332 (i.e. very recently), and I
don't think the effect was clear at that time.

Let's keep the ESC c in place however when we actually want to clear the
screen. Hence move it from reset_terminal_fd() into vt_disallocate().

Fixes: #33689
src/basic/terminal-util.c