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

Support Windows Subsystem for Linux #10

Merged
merged 1 commit into from
Jan 2, 2018
Merged

Conversation

dyong0
Copy link
Contributor

@dyong0 dyong0 commented Dec 30, 2017

Fixes #5

It determines the directory path by checking Windows shell path.
The shell paths are listed in the official VS Code page.
https://code.visualstudio.com/docs/editor/integrated-terminal

Please kindly consider this pull request to be merged, I really need this feature.

Screen captures of the actual usages:

"terminal.integrated.shell.windows": "C:\\Windows\\System32\\bash.exe"

image

"terminal.integrated.shell.windows": "C:\\Program Files\\Git\\bin\\bash.exe"

image

Copy link
Owner

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, would be good to have this one change though.

src/extension.ts Outdated

const lowerCase = windowsShellPath.toLowerCase();

return (lowerCase.indexOf('system32') !== -1) && (lowerCase.indexOf('bash') !== -1);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could probably make this detection a little better by checking if Windows is running in WoW64 mode (more info) and also using %windir%, you can see how this is done in VS Code here:

https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/parts/terminal/electron-browser/terminalService.ts#L172-L185

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree. Seeing the reference, I feel that there's no common module that detects bash used in the target system. But in this case, I can implement the detection in the same way, and refer to the source code from src/extension.ts. Let me make another commit for it.

Fixes Tyriar#5

Determine the bash path by checking Windows shell path in config.
@dyong0
Copy link
Contributor Author

dyong0 commented Jan 1, 2018

@Tyriar I fixed the issue according to your review, but amended the commit instead of making new one. Because the new commit wouldn't help others. And the test result is same as before.

Copy link
Owner

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Tyriar Tyriar merged commit 6c97420 into Tyriar:master Jan 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants