-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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
Command aware terminals #20676
Comments
Related idea that would likely be more reliable on Mac/Linux xtermjs/xterm.js#576 |
The current thinking is to inject escape sequences into the prompt for supported shells (xtermjs/xterm.js#576) and fall back to regex matching (this issue), which can be customized by the user |
Getting the cwd on windows using WDK: https://stackoverflow.com/a/25853120/1156119 |
This was for the most part done by the command tracking feature (cmd+[shift+]up/down) |
This is a proposal to improve VS Code's integration with the terminal output. Currently you may have noticed that the names terminals have in the dropdown may not represent the command currently being run, especially on Windows.
Problem
On Linux and macOS the behavior is to use the name of the process executable, this does update when new processes are run but unfortunately there is up to a 200ms delay in doing this as we need to poll for it.
On Windows the behavior is to always use the basename of the shell process executable (eg. powershell.exe, cmd.exe, etc.), this does not change when there is a command run or a shell change.
Due to these limitations we can't reliably tell what process/args are currently being run, and therefore cannot surface this information to integrations.
Potential Solution
A setting something like this could be introduced:
Then depending on the process title we have access to described in the Problem section, we can select the valid item from
promptMatchers
. This could then be used on every line of output to detect when each command starts and finished.This would enable, among other things, the ability to register link matchers under certain conexts. For example:
Given a shell with the default configuration this would allow us to linkify common commands in a relatively
Edge Cases
Questions
Related items
Blocked by
The text was updated successfully, but these errors were encountered: