Skip to content

Commit d5b6c6e

Browse files
committed
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.
1 parent 68e4c63 commit d5b6c6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/basic/terminal-util.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ int reset_terminal_fd(int fd, bool switch_to_text) {
273273
termios.c_iflag |= ICRNL | IMAXBEL | IUTF8;
274274
termios.c_oflag |= ONLCR | OPOST;
275275
termios.c_cflag |= CREAD;
276-
termios.c_lflag = ISIG | ICANON | IEXTEN | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOPRT | ECHOKE;
276+
termios.c_lflag = ISIG | ICANON | IEXTEN | ECHO | ECHOE | ECHOK | ECHOCTL | ECHOKE;
277277

278278
termios.c_cc[VINTR] = 03; /* ^C */
279279
termios.c_cc[VQUIT] = 034; /* ^\ */

0 commit comments

Comments
 (0)