Terminal changes C: to c: #21466

Closed
opened 2026-01-31 07:45:33 +00:00 by claunia · 4 comments
Owner

Originally created by @mikedice on GitHub (Apr 1, 2024).

Windows Terminal version

1.19.10573.0

Windows build number

Microsoft Windows [Version 10.0.22631.3296]

Other Software

Visual Studio 2022 Developer Command Prompt v17.9.3

Steps to reproduce

Just open the VS2022 Command prompt in terminal. I see, the root of the C drive (the only drive on the computer) is lower case 'c:' instead of uppercase 'C:'. This breaks an important script used by my team for website development. I have a bug for the JS package filed too here: https://github.com/vitejs/vite/issues/16324

While I understand that changing the case of the root of the drive is not technically wrong on Windows since c:\ and C:\ represent the same thing, it should be avoided if possible because some tools and scripts like Vite will be sensitive to that kind of change. What is the reason for the case change? Can it be avoided?

Expected Behavior

Use the casing for the root drive that is assigned by the operating system.

Actual Behavior

Terminal does not use the casing for the root drive that is assigned by the operating system and this can break tools that are sensitive to such changes.

Originally created by @mikedice on GitHub (Apr 1, 2024). ### Windows Terminal version 1.19.10573.0 ### Windows build number Microsoft Windows [Version 10.0.22631.3296] ### Other Software Visual Studio 2022 Developer Command Prompt v17.9.3 ### Steps to reproduce Just open the VS2022 Command prompt in terminal. I see, the root of the C drive (the only drive on the computer) is lower case 'c:\' instead of uppercase 'C:\'. This breaks an important script used by my team for website development. I have a bug for the JS package filed too here: https://github.com/vitejs/vite/issues/16324 While I understand that changing the case of the root of the drive is not technically wrong on Windows since c:\ and C:\ represent the same thing, it should be avoided if possible because some tools and scripts like Vite will be sensitive to that kind of change. What is the reason for the case change? Can it be avoided? ### Expected Behavior Use the casing for the root drive that is assigned by the operating system. ### Actual Behavior Terminal does not use the casing for the root drive that is assigned by the operating system and this can break tools that are sensitive to such changes.
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 07:45:34 +00:00
Author
Owner

@github-actions[bot] commented on GitHub (Apr 1, 2024):

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@github-actions[bot] commented on GitHub (Apr 1, 2024): Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! ### Open similar issues: - [Settings UI: Check that the starting directory is normalized (#15093)](https://github.com/microsoft/terminal/issues/15093), similarity score: 0.76 > Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Author
Owner

@zadjii-msft commented on GitHub (Apr 1, 2024):

  • Does this repro if the vintage "Windows Console Host" is set as your default terminal in the settings app?
  • In a VS prompt, what is the output of set HOMEDRIVE & set SystemDrive?
  • Same question, but in a normal CMD tab?
  • Does anything look askew (DHowett EDIT: it said eschew) in the Environment Variables settings dialog/?
@zadjii-msft commented on GitHub (Apr 1, 2024): * Does this repro if the vintage "Windows Console Host" is set as your default terminal in the settings app? * In a VS prompt, what is the output of `set HOMEDRIVE & set SystemDrive`? * Same question, but in a normal CMD tab? * Does anything look askew (DHowett EDIT: it said `eschew`) in the Environment Variables settings dialog/?
Author
Owner

@mikedice commented on GitHub (Apr 1, 2024):

In my Terminal app Windows Console Host is set as the Default Terminal Application

From VS2022 Command prompt in Terminal
c:\Users\mikedice\source\repos>set HOMEDRIVE
HOMEDRIVE=C:

c:\Users\mikedice\source\repos>set SystemDrive
SystemDrive=C:

From classic command prompt
C:\Users\mikedice>set systemdrive
SystemDrive=C:

C:\Users\mikedice>set homedrive
HOMEDRIVE=C:

I dumped all environment variables and I do see this:
VSCMD_START_DIR=c:\users\mikedice\source\repos
In fact this is the only place lower case c: is shown

And then I saw that VSCMD_START_DIR=c:\users\mikedice\source\repos was set in the terminal Command Line property: cmd /k "set VSCMD_START_DIR=C:\users\mikedice\source\repos & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -startdir=auto -arch=x64 -host_arch=x64"
I think I remember now setting that so the vsdevcmd prompt lands where i want it to and in that Command Line I used lower case c:

Guess this issue can be resolved by design

@mikedice commented on GitHub (Apr 1, 2024): In my Terminal app Windows Console Host is set as the Default Terminal Application From VS2022 Command prompt in Terminal c:\Users\mikedice\source\repos>set HOMEDRIVE HOMEDRIVE=C: c:\Users\mikedice\source\repos>set SystemDrive SystemDrive=C: From classic command prompt C:\Users\mikedice>set systemdrive SystemDrive=C: C:\Users\mikedice>set homedrive HOMEDRIVE=C: I dumped all environment variables and I do see this: VSCMD_START_DIR=c:\users\mikedice\source\repos In fact this is the only place lower case c: is shown And then I saw that VSCMD_START_DIR=c:\users\mikedice\source\repos was set in the terminal Command Line property: cmd /k "set VSCMD_START_DIR=C:\users\mikedice\source\repos & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -startdir=auto -arch=x64 -host_arch=x64" I think I remember now setting that so the vsdevcmd prompt lands where i want it to and in that Command Line I used lower case c: Guess this issue can be resolved by design
Author
Owner

@DHowett commented on GitHub (Apr 1, 2024):

Ah! Thanks for following up.

I usually work around this with the -SkipAutomaticLocation argument to Enter-VsDevShell or the -startdir=none argument to vsdevcmd. That puts Terminal in charge of the starting directory, so you can use the normal Starting Directory setting.

We haven't done this by default for consistency with the existing Developer Shell shortcuts in the start menu.

I'll close this one out! Thanks!

@DHowett commented on GitHub (Apr 1, 2024): Ah! Thanks for following up. I usually work around this with the `-SkipAutomaticLocation` argument to `Enter-VsDevShell` or the `-startdir=none` argument to vsdevcmd. That puts Terminal in charge of the starting directory, so you can use the normal Starting Directory setting. We haven't done this by default for consistency with the existing Developer Shell shortcuts in the start menu. I'll close this one out! Thanks!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21466