terminal-util: drop ECHOPRT flag from TTY settings when resetting
authorLennart Poettering <lennart@poettering.net>
Wed, 22 Nov 2023 12:10:16 +0000 (13:10 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 22 Nov 2023 12:27:53 +0000 (13:27 +0100)
commitd5b6c6e3781b0c48f819bdfe2548d44a6583ec41
tree1bfc72ccd14cb953b1a7828156317a3746089351
parent68e4c637f8cda2cc5750e1e04a422e6750c6f2e5
terminal-util: drop ECHOPRT flag from TTY settings when resetting

Let's disable ECHOPRT for terminals we reset.

The feature only really makes sense for hardcopy terminals and we sure
as shit don't talk to one of those. It has the effect that when line
editing is on and you hit backspace it outputs "\" followed by the
removed character. This never makes sense on a TTY that can just erase
the character.

Hence turn of this flag.

We have carried this flag along for about forever, but it doesn't really
make sense. I guess we mostly tested the terminal reset stuff for output
only, not for input.

This change is in particular useful for tools such as
"systemd-firstboot" which interactively ask questions on the console,
and where line editing should really work.
src/basic/terminal-util.c