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

Option to emit forward slashes for workspaceFolder and fileDirname variables on windows #109300

Closed
yousefwalid opened this issue Oct 24, 2020 · 4 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@yousefwalid
Copy link

yousefwalid commented Oct 24, 2020

I'm using Git Bash on windows, vscode emits workspaceFolder and fileDirname with back slashes which are ignored in Git Bash, this creates an issue with paths.
Should there be an option to change backward slashes to forward slashes?
To my understanding, forward slashes work in all environments, why is it not the default?

I also tried adding the feature myself but I need some guidance as I haven't contributed to any big open source projects before.

Edit:

When creating C++ build and debug tasks, vscode generates two files: launch.json and task.json, these two files contain information about the program directory, the path of the executable to be generated.
Both can be noticed in this code snippet:

  "configurations": [
    {
      "program": "${fileDirname}/${fileBasenameNoExtension}.exe",
      "cwd": "${workspaceFolder}",
      // ... more properties
    }
  ]

The ${fileDirname} and ${workspaceFolder} parameters emitted by vscode generated the file directory path with backward slashes on windows, eg: D:\examplefolder\subfolder.
This works well on cmd but doesn't work with Git Bash, because Git Bash required backslashes to be escaped.

However, both cmd and Git Bash accept forward slashes as path separators, the option requested is a vscode settings option to make these variables generate forward slashes instead of backward slashes on windows

@vscodebot
Copy link

vscodebot bot commented Oct 24, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@joaomoreno
Copy link
Member

joaomoreno commented Oct 26, 2020

vscode emits workspaceFolder and fileDirname

What do you mean by emits? What feature is this?

@joaomoreno joaomoreno added the info-needed Issue requires more information from poster label Oct 26, 2020
@yousefwalid
Copy link
Author

vscode emits workspaceFolder and fileDirname

What do you mean by emits? What feature is this?

Sorry, post updated with more info.

@joaomoreno joaomoreno assigned alexr00 and unassigned joaomoreno Oct 26, 2020
@alexr00
Copy link
Member

alexr00 commented Oct 26, 2020

If we solve #38381 then we should make the solution solve this too. Marking as duplicate.

@alexr00 alexr00 closed this as completed Oct 26, 2020
@alexr00 alexr00 added *duplicate Issue identified as a duplicate of another issue(s) and removed info-needed Issue requires more information from poster labels Oct 26, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
*duplicate Issue identified as a duplicate of another issue(s)
Projects
None yet
Development

No branches or pull requests

3 participants