-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
Lower case drive letter in Open New Command Prompt command on Windows #9448
Comments
More details: Assigning to @Tyriar since he was the most active in the terminal area recently. |
@kieferrm thanks, I just confirmed that opening Code without any file or folder will keep the drive upper-case. However, I still see the drive lower-cased if I right-click on a single file in Explorer and choose Open with Code so that just the file is opened and the explorer panel says "you have not yet opened a folder". Maybe this helps narrow it down a little more? |
I am hitting this exact same issue using gulp-typescript to compile typescript files through a build task. Turning off the compiler option is a workaround but that can cause issues on non-windows. |
VSCode using c:\ instead of the usual C:\ is annoying because it breaks all the code that makes incorrect assumptions about paths. I think the real bug is this: microsoft/TypeScript#10095 |
@Tyriar Sorry if I have missed anything. Is there any fix for it? Is there a solution to force open cmd/terminal with uppercase drive letter? |
@asadsahi no I don't think there is a work around yet. |
Okay, Thanks @Tyriar will keep an eye on this issue. |
I've root caused this to a line in the |
Thanks @Tyriar can this be a specific fix for windows if other OS's need to have a lowercase drive letter? Can you explain what is design decision behind this? |
@asadsahi the |
Ohh ok. Thanks @Tyriar . |
Here's a temporary workaround of sorts for both integrated and external consoles:
Here's the same thing in a more condensed relative format that doesn't require copying/typing the path as long as you remember the syntax, but that should be no problem considering how much you'll be typing it until this is fixed ;-)
It leverages the ability to change the drive casing when changing directories, and the more condensed form shows the |
Thanks a lot @rob3c! Much appreciated as this bug will be in stable for another month or so. |
@asadsahi unfortunately, it's not automated, so we have to manually type it in each time. Just open an integrated terminal, for example, and type this in: |
You may be able to use a .bat file which launches cmd and then runs |
You can try something similar to #7263 (comment) but make the bat file:
Then set |
@Tyriar is right, you can automate it with a batch file in settings.json:
If you use the same batch file for both, you'll need to type |
@rob3c @Tyriar Thanks once again. Got both working with following config:
batch file content:
@rob3c Didn't get what you mean by using exit twice? where would I use exit command? I tried using before/after %COMSPEC%` but that didn't open the terminals. Can you please explain that a little bit. |
@asadsahi I meant if using the |
This change needs to be made at this layer since a change to URI.fsPath (the root cause) is too risky as lower case drives are relied upon. Part of #9448
Otherwise running phpstan on itself fails when run in cmd opened with c:/ instead of C:/ They had similar issue in VSCode microsoft/vscode#9448
Otherwise running phpstan on itself fails when run in cmd opened with c:/ instead of C:/ They had similar issue in VSCode microsoft/vscode#9448
Otherwise running phpstan on itself fails when run in cmd opened with c:/ instead of C:/ They had similar issue in VSCode microsoft/vscode#9448
Otherwise running phpstan on itself fails when run in cmd opened with c:/ instead of C:/ They had similar issue in VSCode microsoft/vscode#9448
BUG REPRO HERE: https://github.com/rob3c/tsc-tsnode-vscode-casing-bug-on-windows
Overview
Starting with the 2016-07-14 release of Visual Studio Code Insiders edition (and now released in regular VS Code 1.3.1), the behavior of the Open New Command Prompt command (
ctrl+shift+C
) changed on Windows. Now, it lower-cases the drive letter in the new console's prompt, and that seems to affect the ability of at leastts-node
(and possibly other tools) to build typescript code when theforceConsistentCasingInFileNames
compiler option is set in tsconfig.json.Step 1 - Open two command prompts for comparison
Open New Command Prompt
command viactrl+shift+C
(or find it using View | Command Palette... in the menu). Notice that the drive letter in the prompt is lower case now!Step 2 - create some source files
Step 3 - Build successfully using typescript directly
This builds successfully in both command prompt windows.
Step 4 - Break stuff!
This builds and runs successfully in the standard Windows command prompt that has an upper-case drive letter, but it breaks in the console window that VS Code opens with this error:
BUG REPRO HERE: https://github.com/rob3c/tsc-tsnode-vscode-casing-bug-on-windows
The text was updated successfully, but these errors were encountered: