-
Notifications
You must be signed in to change notification settings - Fork 28k
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
Shell integration isn't enabled for Debug terminals #204694
Comments
@karrtikr do you set the executable in |
@karthiknadig @paulacamargo25 Can you help with how Python debugger is launched? |
Debugger uses the |
I think this is by design, can't you control debug terminal environments separately? |
I'm not clear, can you instruct specifically if there's anything we can check Python's debugger end that might be preventing from using shell integration? Based on previous discussions, I think VS Code controls the entire experience, and as it predates shell integration feature, maybe shell integration is not getting invoked for such terminals. |
Debug terminals normally run a single command and therefore would get very little out of shell integration. I wouldn't think we should touch such processes anyway in case shell integration somehow conflicts with them. Can't you control debug terminal environments separately? |
Users expect our debug terminals to be activated, hence shell integration to set environment variables reliably is required there.
I would expect debug terminal's environment to be the same as any other normal terminal, or at least an option to make it same as normal terminal would be nice.
We can configure the "env" before launching, but that does not persist in terminal after debugging finishes, also shell integration would still be inactive. |
I haven't used It is probably safe to add this, it's not being activated because the shell is passed in explicitly here: vscode/src/vs/workbench/api/node/extHostDebugService.ts Lines 87 to 101 in a8cda87
Which disables shell integration here ( vscode/src/vs/platform/terminal/node/terminalEnvironment.ts Lines 115 to 122 in a8cda87
I think the reason for passing |
Thanks, is it also possible to enable it for task terminals: microsoft/vscode-python#22880 ? Some users launch certain apps via tasks, expecting environment to be activated, and hence are failing because shell integration isn't active. |
It's harder for tasks as we run the command in a similar way to how we initialize shell integration as opposed to sending the command in the debug terminal. We could probably do it, but I worry there would be changes in behavior and sometimes it might not work if shell integration is in a weird state. cc @meganrogge |
I see, the thing we wanted to accomplish was to prepend an env variable exactly once via env collection, be it via shell integration (preferred) or process creation but not both. If shell integration isn't available for a terminal type, if we can apply those variables at process creation instead, that would also solve the issue. |
Doing this for debug terminals makes sense. For tasks I don't think it's possible, I believe you can set the environment for the tasks you make? |
@karthiknadig @paulacamargo25 Can we use TerminalOptions to alter the environment for the terminal launched via debugging? |
That's not us running tasks, it's the users, so we cannot control their environment unfortunately, unless it's via env collection. Also, what do you think about falling back to process creation if shell integration does not work for a terminal? #204694 (comment) |
@karrtikr I'd ask @meganrogge about how to handle the tasks case |
Had a chat with @karthiknadig and he says that as the whole debugging experience is configured by core, Python extension does not control the @Tyriar Is there a possibility to always enable shell integration for integrated terminal, instead of providing an option? @int19h Can you help with what options Python extension does control when launching the "Python debug console" terminal when debugging? And if there is a way to influence |
@connor4312 , are you aware if we, the Python extension, can influence the DAP client so that when it creates the debug terminal, we control the creationOptions? |
No. But I would also be fine if we wanted to add a custom property in VS Code+the Python extension to |
Does this issue occur when all extensions are disabled?: Yes/No
Version: 1.86.0 (user setup)
OS: Windows_NT x64 10.0.23620
Steps to Reproduce:
Try debugging a Python file using the Python extension,
Particularly for debug console terminal, shell integration script isn't used:
![image](https://private-user-images.githubusercontent.com/13199757/303263024-1f7e28bd-587c-455a-a326-c2b6deabedfe.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkzMDY3ODgsIm5iZiI6MTcxOTMwNjQ4OCwicGF0aCI6Ii8xMzE5OTc1Ny8zMDMyNjMwMjQtMWY3ZTI4YmQtNTg3Yy00NTVhLWEzMjYtYzJiNmRlYWJlZGZlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI1VDA5MDgwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWNmYWMxNTkzYWZiOWQ2OTAxMDY0Yjc4Y2RiY2VkNjRhZjZhMTgxYjg2NjZkZDdlNzMwNjJhOWNmY2UzNmFkNDMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.WZdWBcmR93yNIZ6z38CGHiB_jOC9T3FdcS0S5i2un4Y)
But when a normal terminal is opened, it is used:
![image](https://private-user-images.githubusercontent.com/13199757/303263281-2b9150d8-3224-4df3-bc99-2666793351d5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkzMDY3ODgsIm5iZiI6MTcxOTMwNjQ4OCwicGF0aCI6Ii8xMzE5OTc1Ny8zMDMyNjMyODEtMmI5MTUwZDgtMzIyNC00ZGYzLWJjOTktMjY2Njc5MzM1MWQ1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjI1VDA5MDgwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTMwYzk2NzQzMWVjYjJmNTAwZjY1NzJkMmQ5ZWYxYTRmMTExYzM4ZDEyMTQ1NjgyYjI1ZDA3OTlkMjQzMTEzMTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.fQk5n5bvfOHzdyebWq3W2MVwLpUCy45FrxV03K0fk9k)
This is leading to broken experience when applying environment collection just using shell integration.
The text was updated successfully, but these errors were encountered: