elvish icon indicating copy to clipboard operation
elvish copied to clipboard

TTY modes left in inconsistent state when external command is killed

Open krader1961 opened this issue 4 years ago • 2 comments

Consider this interactive Elvish scenario:

  1. You run an external command (e.g., an editor such as vim) that modifies the TTY behavior.

  2. 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.

krader1961 avatar Nov 17 '20 05:11 krader1961

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.

krader1961 avatar Nov 19 '20 03:11 krader1961

This is still broken. See also issues #732 and #1469.

krader1961 avatar Jan 18 '24 03:01 krader1961