You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"File" -> "Open Folder", then navigate to and select the directory with the above file in it.
Create a default node debug config in launch.json
Add "args": ["${workspaceFolder}"] to pass it as the first param (which will be logged above
Add "console": "integratedTerminal" to use integrated terminal. This gives a launch.json of:
{// Use IntelliSense to learn about possible attributes.// Hover to view descriptions of existing attributes.// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387"version": "0.2.0","configurations": [{"type": "node","request": "launch","name": "Launch Program","program": "${workspaceFolder}/test.js","args": ["${workspaceFolder}"],"console": "integratedTerminal"}]}
Actual Output:
D:\test>cd d:\test && node --inspect-brk=15398 test.js d:\test
Debugger listening on ws://127.0.0.1:15398/5d5674d0-9a73-4e7a-bb58-658d7ca0d24f
For help see https://nodejs.org/en/docs/inspector
Debugger attached.
__dirname D:\test
${workspaceFolder} d:\test
Waiting for the debugger to disconnect...
D:\test>
Notes:
The path in the terminal window uses a capital "D".
The internal path appears to use a lower case "d". This can be seen in both the logged value of ${workspaceFolder}, and in the command line that launches the debug session.
If using, "Command Prompt" console, it is possible to manually change the current directory to a lowercase drive letter to make them match, but that is not the default.
Expected Output:
The drive letter case used by the integrated terminal and that used by the integrated terminal should match.
This is important because node considers files with a different case to be different files during require(). Passing paths to a node script that are built using ${workspaceFolder} and using them to require files causes different casing between otherwise identical filepaths.
Given that:
The file explorer with which the folder was selected in "File" -> "Open Folder" showed upper case "D"
AFAIK, upper case is the canonical form in Windows (as enforced in Explorer, Powershell, etc.)
I believe it is impossible to make Powershell (the default integratedTerminal) use lower case drive letters.
Then VSCode should internally use the uppercase form.
Notes
This DOES NOT happen using the "internalConsole". The drive letter is lowercase in both cases.
This DOES happen with both "Powershell" and "Command Prompt" consoles.
@bpasero duplicate of #12448 ?
Since the workspace folder path should not enter lowercase in our sistem in the first place. When I am replacing in the configuration resovler service I simply take what the context service gives me
@isidorn as far as I know we do some normalization of drive letters in the URI class (@jrieken can correct me if I am wrong), so I would assume that at least as long as URIs are being used, we are consistent everywhere.
It is true however that we have a helper method normalizeDriveLetter that we use whenever a URI path is being displayed in the UI because indeed on Windows the default seems to be uppercase.
Ideally fsPath would return uppercase drive letters on Windows imho.
Yeah it could break quite a bit of things. @isidorn maybe at your point you should just normalize the drive letter then? It does not seem to be an issue in any other places so far except this one.
isidorn
added
bug
Issue identified by VS Code Team member as probable bug
config
VS Code configuration, set up issues
labels
Jan 29, 2018
Steps to Reproduce:
__dirname
and the first argument to your program. e.g."args": ["${workspaceFolder}"]
to pass it as the first param (which will be logged above"console": "integratedTerminal"
to use integrated terminal. This gives a launch.json of:Actual Output:
Notes:
Expected Output:
The drive letter case used by the integrated terminal and that used by the integrated terminal should match.
This is important because node considers files with a different case to be different files during
require()
. Passing paths to a node script that are built using ${workspaceFolder} and using them to require files causes different casing between otherwise identical filepaths.Given that:
Then VSCode should internally use the uppercase form.
Notes
"internalConsole"
. The drive letter is lowercase in both cases.The text was updated successfully, but these errors were encountered: