Skip to content
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

[Debugging] RunInTerminal doesn't use the specified integrated terminal from workspace settings #108559

Closed
testforstephen opened this issue Oct 13, 2020 · 7 comments
Assignees
Labels
*as-designed Described behavior is as designed confirmed Issue has been confirmed by VS Code Team member debug Debug viewlet, configurations, breakpoints, adapter issues verification-found Issue verification failed
Milestone

Comments

@testforstephen
Copy link

If my default integrated terminal in Visual Studio Code is git-bash then an error happens. I found out that a workaround is to change the default integrated terminal to cmd or powershell. I tried changing the current terminal in my workspace settings to cmd.exe, but when I hit F5 to start debugging it incorrectly uses git-bash.

If I change the global settings files, then the debugger works as expected... but I don't want to change it globally as I work with git-bash in most of my other projects.

If I press the + button to create a new terminal, it creates a new cmd terminal as expected, using the workspace settings file definition for the default terminal.

Environment
  • Operating System: Windows 10
  • JDK version: 14
  • Visual Studio Code version: 1.48.2
  • Java extension version: 0.10.0
  • Java Debugger extension version: 0.28.0
Steps To Reproduce
  1. Set git-bash as default integrated terminal in your global settings.
  2. Set cmd as default integrated terminal in your workspace settings.
  3. Press F5 to launch and start debugging
Current Result

It starts debugger using git-bash (which does not work for me):

image

Expected Result

Start debugging in a cmd.exe terminal (which works nicely):

image

(to get this screenshot I had to set the global default terminal)

Originally posted by @masbicudo in microsoft/vscode-java-debug#877 (comment)

@connor4312 connor4312 assigned weinand and unassigned connor4312 Oct 13, 2020
@connor4312 connor4312 added the debug Debug viewlet, configurations, breakpoints, adapter issues label Oct 13, 2020
@weinand weinand added the bug Issue identified by VS Code Team member as probable bug label Nov 5, 2020
@connor4312
Copy link
Member

This looks like more a bug in the terminal API side of things. I can repro this as well using vscode.window.createTerminal from an extension (which is the API that debug also uses internally).

@connor4312 connor4312 assigned meganrogge and unassigned weinand Nov 13, 2020
@connor4312 connor4312 added the confirmed Issue has been confirmed by VS Code Team member label Nov 13, 2020
@connor4312
Copy link
Member

connor4312 commented Nov 13, 2020

Nevermind, I missed the permission banner in the corner. Could be related #109111

@connor4312 connor4312 assigned connor4312 and weinand and unassigned meganrogge Nov 13, 2020
@weinand
Copy link
Contributor

weinand commented Nov 17, 2020

I don't quite understand the issue...

But may be the following FYIs help:

@connor4312
Copy link
Member

connor4312 commented Nov 17, 2020

I poked at it a little bit. I thought it wasn't pulling the workspace, and pinged Daniel about it

// TODO: Pull this from main side
private _isWorkspaceShellAllowed: boolean = false;

He said:

It should be getting set still:

public $acceptWorkspacePermissionsChanged(isAllowed: boolean): void {
this._isWorkspaceShellAllowed = isAllowed;
}

Not sure if the todo is valid anymore but I think it was around setting the initial state and maybe pulling it from main instead of pushing

I haven't looked at it again since

@connor4312
Copy link
Member

connor4312 commented Mar 31, 2021

This seems to work now after clicking the "allow workspace shell" prompt.

Verification:

  1. Set your global shell to something, like git bash
  2. Set your workspace shell to something else, like powershell
  3. Use a launch config like this and F5:
{
  "type": "node",
  "request": "launch",
  "console": "integratedTerminal",
  "name": "[Node] Launch program",
  "program": "${workspaceFolder}/main.js",
},
  1. You will probably get the workspace shell prompt and it'll launch in the global terminal the first time. After you allow the workspace to modify your shell, it'll launch in the workspace shell correctly.

@connor4312 connor4312 added this to the April 2021 milestone Mar 31, 2021
@alexr00
Copy link
Member

alexr00 commented Apr 29, 2021

@connor4312 It looks like default shell settings are no longer respected at all in workspace settings. I've verified that the original behavior in the bug occurs still. Seems like this is probably by design.

@alexr00 alexr00 reopened this Apr 29, 2021
@alexr00 alexr00 added the verification-found Issue verification failed label Apr 29, 2021
@connor4312
Copy link
Member

Yea it looks like the new profiles are only applied on a per-user basis. So this would now be as designed.

@connor4312 connor4312 added *as-designed Described behavior is as designed and removed bug Issue identified by VS Code Team member as probable bug labels Apr 29, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Jun 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*as-designed Described behavior is as designed confirmed Issue has been confirmed by VS Code Team member debug Debug viewlet, configurations, breakpoints, adapter issues verification-found Issue verification failed
Projects
None yet
Development

No branches or pull requests

5 participants