bash assumes ECHO is enabled for the tty

This commit is contained in:
Kovid Goyal 2022-02-22 20:43:58 +05:30
parent dac9b07f16
commit 4487462b0d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 2 deletions

View File

@ -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

View File

@ -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)