From 07cc7eed295a29afef37c4bfaabaf57a3f4af0c1 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Tue, 3 Aug 2021 23:58:06 +0200 Subject: [PATCH] Shell: Make sure TTY echo is enabled when running external commands When running external commands via "Shell -c" LibLine turns of TTY echo before running the command. This ensures that it is turned on. --- Userland/Shell/Shell.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Userland/Shell/Shell.cpp b/Userland/Shell/Shell.cpp index 2c2a5fff29..828b9f1c0c 100644 --- a/Userland/Shell/Shell.cpp +++ b/Userland/Shell/Shell.cpp @@ -568,9 +568,12 @@ int Shell::run_command(const StringView& cmd, Optional source_po } tcgetattr(0, &termios); + tcsetattr(0, TCSANOW, &default_termios); command->run(*this); + tcsetattr(0, TCSANOW, &termios); + if (!has_error(ShellError::None)) { possibly_print_error(); take_error();