-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Esc in terminal window does not shift focus back to the document well. #13
Comments
I'm not sure if this is a feature I can support. For simple terminal applications it would be trivial to contextualize it. But consider the case where a user has an application such as vim open. The esc key has an important function in vim and since vim uses ncurses to write text at various locations in the terminal window there is no reliable way to contextualize it. Users can always use Ctrl+Tab to navigate away from the terminal without a mouse. |
Are you able to tell when an executable is running vs when just idling in the shell waiting for input? I think it would be an acceptable tradeoff for Esc to only release focus when sitting idle and not in another console app. The challenge you're going to continually encounter is terminal behavior conflicting with standard VS windowing/keyboard behavior. Finding the right balance is going to be key to this feeling right in the IDE. It's looking promising so far! |
Unfortunately I don't think there is a way for me to determine if there is a currently running process from the interface I have available to me. I use node-pty as a backend and it doesn't appear to offer me any hooks to determine if there is a running process. |
This should be closed as designed imo.
node-pty just provides an input and an output stream, to us/xterm.js there is no differentiating input, prompt and output. This is something I've been thinking of for quite a while though so it may eventually be solved. I recommend not bothering looking into this but instead tracking microsoft/vscode#20676 for updates, it is not anywhere near as trivial as it seems 😃
This is true, even if there was I'd recommend against it as esc can be eaten by processes that are not the outer shell too. (eg. vim).
VS Code gets around this by having a concept of "commands to skip the shell"; a list of commands that will not be sent to be handled by xterm.js. I'm not sure if this would translate well to VS. |
This issue was moved to microsoft/WhackWhackTerminal#15 |
In VS tool windows, the Esc key generally returns focus back to the previously active document. It would be nice if terminal window supported this as well since it's such a common muscle memory.
I wouldn't want to lose the behavior where Esc clears the input line in the terminal window, though. Perhaps Esc should be special cased to support both. If the user has typed input, then Esc should clear the line and keep focus in the terminal. If there is no input, then Esc could release focus from the tool window.
The text was updated successfully, but these errors were encountered: