From 4487462b0d37468d53c4390d2dee686c39fd8e59 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 22 Feb 2022 20:43:58 +0530 Subject: [PATCH] bash assumes ECHO is enabled for the tty --- kitty_tests/__init__.py | 3 +++ kitty_tests/shell_integration.py | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/kitty_tests/__init__.py b/kitty_tests/__init__.py index 889b92435..401577817 100644 --- a/kitty_tests/__init__.py +++ b/kitty_tests/__init__.py @@ -171,6 +171,9 @@ class PTY: time.sleep(0.01) if cwd: os.chdir(cwd) + new = termios.tcgetattr(sys.stdin.fileno()) + new[3] = new[3] | termios.ECHO + termios.tcsetattr(sys.stdin.fileno(), termios.TCSADRAIN, new) os.execvpe(argv[0], argv, env or os.environ) os.set_blocking(self.master_fd, False) self.cell_width = cell_width diff --git a/kitty_tests/shell_integration.py b/kitty_tests/shell_integration.py index ec7864146..bc533a77e 100644 --- a/kitty_tests/shell_integration.py +++ b/kitty_tests/shell_integration.py @@ -41,8 +41,6 @@ def safe_env_for_running_shell(home_dir, rc='', shell='zsh'): print('set +o posix', file=f) # ensure LINES and COLUMNS are kept up to date print('shopt -s checkwinsize', file=f) - # Not sure why bash turns off echo in this scenario - print('stty echo', file=f) if rc: print(rc, file=f) print(rc_inset('bash'), file=f)