Ver código fonte

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.
Gunnar Beutner 4 anos atrás
pai
commit
07cc7eed29
1 arquivos alterados com 3 adições e 0 exclusões
  1. 3 0
      Userland/Shell/Shell.cpp

+ 3 - 0
Userland/Shell/Shell.cpp

@@ -568,9 +568,12 @@ int Shell::run_command(const StringView& cmd, Optional<SourcePosition> 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();