Tyriar / vscode-terminal-here

VS Code extensions that creates an integrated terminal session at the current file's directory
https://marketplace.visualstudio.com/items?itemName=Tyriar.vscode-terminal-here
33 stars 11 forks source link

Change drive letter before cd in case of cmd.exe #11

Closed saaketp closed 6 years ago

saaketp commented 6 years ago

Fixes #4

This checks if the windows shell is cmd.exe similar to wsl bash check in pull request #10.

I modified the "isWslBash" function and made a "kindOfShell" that returns string "wslbash" or "cmd". This was to avoid creating a new function isCmd and duplicating most of the code from isWslBash. So now instead of an if condition we have a switch case.

In cmd.exe cd works only for paths within the current drive letter (which is C: usually when cmd is started). To change the drive letter we need to send the drive letter and a colon to the terminal.

Screen cap:

capture

Tyriar commented 6 years ago

Thanks @saaketp!