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

Can we get a ${dirSep} variable for use in tasks.json and launch.json? #38381

Closed
rkeithhill opened this issue Nov 15, 2017 · 10 comments · Fixed by #105887
Closed

Can we get a ${dirSep} variable for use in tasks.json and launch.json? #38381

rkeithhill opened this issue Nov 15, 2017 · 10 comments · Fixed by #105887
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders tasks Task system issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@rkeithhill
Copy link

  • VSCode Version: 1.18.0
  • OS Version: Windows 10 FCU

Steps to Reproduce:

  1. You have a tasks.json file with a bunch of tasks and separate OS configurations for the path to the exe defined once at the top of the file.
  2. In a few tasks you need to pass the path to an output dir, so you try ${workspaceFolder}/debug which works on Linux/macOS but not on Windows because the underlying utility we use (rcedit) rejects the path.

What I'd like to be able to do is specify ${workspaceFolder}${dirSep}debug and not have to worry about the vagaries of OS dir separators.

Reproduces without extensions: N/A

@vscodebot vscodebot bot added the tasks Task system issues label Nov 15, 2017
@dbaeumer
Copy link
Member

Alternatively we could mark whole paths so that we can even do smarter tricks with WSL and git bash.

@dbaeumer dbaeumer added feature-request Request for new features or functionality debug Debug viewlet, configurations, breakpoints, adapter issues and removed new release labels Nov 15, 2017
@dbaeumer dbaeumer added this to the On Deck milestone Nov 15, 2017
@webia1
Copy link

webia1 commented May 9, 2018

What is the current status? Path seperators are unfortunately not available in vscode/git-bash at all,.. Thank you,..

@dbaeumer
Copy link
Member

Nothing has happened so far. As always a PR is welcome.

Regarding my comment here: #38381 (comment) this might be more complicated since this will make the variable resolving shell dependent which is currently not the case.

@culyun
Copy link

culyun commented Feb 15, 2019

I'm looking for this feature too - specifically in launch.json. I don't know the underlying technology you're using, but isn't it the shell's job to resolve the path?

With that in mind why not intercept process creation and resolve all slash variants one way or the other using tools like cygpath. Use single quoted arguments to prevent path resolution as needed.

@rioj7
Copy link

rioj7 commented Oct 4, 2019

I have added this variable to the extension Command Variable (v0.6.0)

@stt
Copy link

stt commented Jan 7, 2020

Rather surprised how awkward vscode still is to use for Windows users. Installing and using vscode through WSL just to turn \ into / is too much effort IMO, and custom extensions to replace them would force everyone else using the same tasks.json to also have the extension which they didn't need in the first place.

Vscode is a great and useful tool but having people world over waste hours fighting it is rather counter productive. If WSL is truly the only way, couldn't the Windows build at the very least hint at WSL if the user is trying to use bash rather than having them discover it through years worth of github issue backlog?

@njmalhq
Copy link

njmalhq commented May 10, 2020

Ditto @stt this issue, and its closed cohorts have been rendering vscode significantly less usable for three years. Looks like a lot more energy has gone into closing "related" bugs, rather than fixing the problem.

@culyun
Copy link

culyun commented Jul 8, 2020

Is there any traction on this important issue. Seconding @stt + @njmalhq.

@alexr00 alexr00 removed the help wanted Issues identified as good community contribution opportunities label Oct 26, 2020
@weinand weinand modified the milestones: On Deck, November 2020 Dec 6, 2020
@weinand weinand added the verification-needed Verification of issue is requested label Dec 6, 2020
@weinand
Copy link
Contributor

weinand commented Dec 7, 2020

The name of the variable is pathSeparator.

@dbaeumer dbaeumer added the verified Verification succeeded label Dec 7, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders tasks Task system issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

11 participants