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

Open New Command Prompt should honor %COMSPEC% environment variable on Windows #597

Closed
krizzdewizz opened this issue Nov 24, 2015 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities verified Verification succeeded
Milestone

Comments

@krizzdewizz
Copy link
Contributor

On Windows, The 'Open New Command Prompt' command should lookup the %comspec% environment variable instead of using hard-coded 'cmd.exe'.
This enables alternate interpreters/shells to be started - such as TCCLE.
There may be similar things for Linux/OSX.

Thanks for this great tool!

@joaomoreno joaomoreno added bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities labels Nov 25, 2015
@joaomoreno
Copy link
Member

Want to contribute a PR?

@krizzdewizz
Copy link
Contributor Author

Just sent my first PR ever. Hope everything is fine.

@joaomoreno
Copy link
Member

Awesome, I'll take a look as soon as possible! Thanks!

@egamma egamma modified the milestone: Backlog Dec 10, 2015
@pflannery
Copy link

@krizzdewizz @joaomoreno
I have an issue when setting comspec to use bash.
The issue is that the forced arguments passed to spawn affect bash in a different way and closes the process immediately.

Source here -> https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/execution/electron-browser/terminalService.ts#L27
Looking at the code I cant see how this would work for other terminals as it's trying to pass /c start /wait as command arguments which other terminals may or may not support.

I've done some tests and I can get bash to work when supplying cp.spawn('cmd.exe', ['/c', 'start', '/wait', 'bash']).
(Replacing bash with powershell works for too. Also omitting bash leaves cmd.exe to work as default)

This is the test script code I used to get this working for bash.

'use strict';
const cp = require('child_process');
const child = cp.spawn('cmd.exe', ['/c', 'start', '/wait', 'bash'], { cwd: __dirname });
child.on('error', err => {
    console.log("error", err);
});
child.on('exit', code => {
    console.log("terminal closed");
});

I think we should also add the error handling code as it's not present

@pflannery
Copy link

I think we can keep the %comspec% environment variable as is and add a new user\workspace setting like "terminal.launchCommand" for spawning new terminals that are requested by the user.

@joaomoreno joaomoreno modified the milestones: March 2016, Backlog Feb 26, 2016
@joaomoreno joaomoreno modified the milestones: April 2016, March 2016 Mar 15, 2016
@Tyriar Tyriar assigned Tyriar and unassigned joaomoreno Apr 18, 2016
@Tyriar Tyriar closed this as completed Apr 18, 2016
@aeschli aeschli added the verified Verification succeeded label May 2, 2016
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug help wanted Issues identified as good community contribution opportunities verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

7 participants
@joaomoreno @egamma @pflannery @krizzdewizz @Tyriar @aeschli and others