]> git.ipfire.org Git - thirdparty/systemd.git/commit
ptyfwd: reset tty when exiting
authorLennart Poettering <lennart@poettering.net>
Fri, 19 Sep 2025 12:50:53 +0000 (14:50 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 22 Sep 2025 05:39:05 +0000 (14:39 +0900)
commit3d97db8f3c3e86b70d09444965ebfddd051df39c
treeaff5a56f3d51c6a537dd328279ac771cf99f1829
parente6a05af50be2fc7afe69a2ea2b3f14264c75dea7
ptyfwd: reset tty when exiting

Let's do a "soft" reset of the TTY when a ptyfwd session ends. This is a
good idea, in order to reset changes to the scrolling window that code
inside the session might have made. A "soft" reset will undo this.

While we are at it, make sure to output the ansi sequences for this
*after* terminating any half-written line, as that is still somewhat
contents of the session, even if it's augmented.
src/basic/terminal-util.c
src/basic/terminal-util.h
src/shared/ptyfwd.c