elvish
elvish copied to clipboard
TTY modes left in inconsistent state when external command is killed
Consider this interactive Elvish scenario:
-
You run an external command (e.g., an editor such as
vim
) that modifies the TTY behavior. -
That command dies in a manner which doesn't give it an opportunity to restore the TTY behavior that existed before it changed that behavior.
You are now left with an interactive Elvish session that may, or may not, be usable. I noticed this while working on issue #661. See also issue #232 which is essentially the same issue but was limited to what happens when Elvish launches a /bin/sh rescue shell.
Note that this affects the proper setup of the Windows console. Changing the sanitize function in pkg/cli/term/setup_windows.go to call setup(in, out)
"fixes" the correct rendering of ANSI color sequences on Windows. See issue #1165. The question is how to properly setup the TTY at both startup and after an external command terminates.
This is still broken. See also issues #732 and #1469.