fix: use shell integration for more reliable execution for node-temrinal#2152
fix: use shell integration for more reliable execution for node-temrinal#2152connor4312 merged 2 commits intomainfrom
Conversation
| if (!terminal.shellIntegration && config.get(SHELL_INTEGRATION_SETTING) !== false) { | ||
| let listener: vscode.Disposable; | ||
| await Promise.race([ | ||
| delay(SHELL_INTEGRATION_TIMEOUT), |
There was a problem hiding this comment.
For python we're trying to do some caching mechanism to skip this timeout depending on whether the terminal is likely to have shell integration. You could track whether the shell exe and args had shell integration last time and if not revert to sendText immediately (or after some small timeout if needed to avoid this pwsh problem).
There was a problem hiding this comment.
Wonder if the API could signal that to avoid all of us duplicating logic. Some terminal.isLikelyToHaveShellIntegration
There was a problem hiding this comment.
I've thought about that, but it's such an ugly API and doubt it would make it through the syncs tbh. There are some basic examples of fallbacks in the comments but @anthonykim1/Python was about to try out this idea soon.
There was a problem hiding this comment.
It doesn't look like the shell exe / args are available on the vscode.Terminal object, do you have suggestions on how to get those?
There was a problem hiding this comment.
They're in creationOptions, if the shell path is undefined you can assume it's env.shell
Refs microsoft/vscode#236397