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

Variable replacement in tasks.json produces "/"-less paths in cygwin since 1.32 #70211

Closed
yarcod opened this issue Mar 11, 2019 · 7 comments
Closed
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s)

Comments

@yarcod
Copy link

yarcod commented Mar 11, 2019

  • VSCode Version: 1.32
  • OS Version: Windows 7, cygwin

Steps to Reproduce:

  1. Create a task which uses VSCode's variable replacement, e.g. ${relativeFile}.
  2. Echo the result to cygwin terminal.
  3. The output will have paths written without any separators, i.e., "/".

Does this issue occur when all extensions are disabled?: Yes

This used to work perfectly until 1.32 (I think that's when it broke, but fairly recently anyway). This issue is not present if you add an option to use Windows cmd instead; that will show a fully usable path.

@vscodebot vscodebot bot added the search Search widget and operation issues label Mar 11, 2019
@roblourens roblourens assigned dbaeumer and unassigned roblourens Mar 11, 2019
@roblourens roblourens removed the search Search widget and operation issues label Mar 11, 2019
@alexr00
Copy link
Member

alexr00 commented Mar 12, 2019

Looks like a duplicate of #70050, where the relative file's path separators are Windows path separators.

@alexr00 alexr00 added the *duplicate Issue identified as a duplicate of another issue(s) label Mar 12, 2019
@vscodebot
Copy link

vscodebot bot commented Mar 12, 2019

Thanks for creating this issue! We figured it's covering the same as another one we already have. Thus, we closed this one as a duplicate. You can search for existing issues here. See also our issue reporting guidelines.

Happy Coding!

@vscodebot vscodebot bot closed this as completed Mar 12, 2019
@alexr00 alexr00 removed the *duplicate Issue identified as a duplicate of another issue(s) label Mar 12, 2019
@alexr00 alexr00 reopened this Mar 12, 2019
@alexr00
Copy link
Member

alexr00 commented Mar 12, 2019

Actually, this might not be a duplicate. I will investigate more.

@alexr00 alexr00 added the info-needed Issue requires more information from poster label Mar 12, 2019
@alexr00
Copy link
Member

alexr00 commented Mar 12, 2019

@yarcod how do you use Cygwin for your integrated terminal?

@dwarcake
Copy link

Dunno for OP but I use git-bash as my default shell and seem to have the same problem

Snippet of our tasks.json file:

{
            "label": "Run aut",
            "group": "none",
            "type": "shell",
            "args": ["some_conenction", "@${relativeFile}"],
            "presentation": {
                "echo": true,
                "reveal": "silent",
                "focus": false,
                "panel": "shared",
                "showReuseMessage": true,
                "clear": false
            },

@dbaeumer dbaeumer removed their assignment Mar 13, 2019
@alexr00
Copy link
Member

alexr00 commented Mar 13, 2019

Since the only instances of this happening are with relativeFile, this is a duplicate of #70050. See that issue for all the info, but relativeFile was incorrect. It is now fixed and has OS specific path separators.

@alexr00 alexr00 closed this as completed Mar 13, 2019
@alexr00 alexr00 added *duplicate Issue identified as a duplicate of another issue(s) and removed info-needed Issue requires more information from poster labels Mar 13, 2019
@yarcod
Copy link
Author

yarcod commented Mar 14, 2019

Sorry for the late reply! I looked at the possible duplicate and saw two things that did not align with my issue:

  • The issue was limited to ${relativeFile} specifically, while I'm having issues with all variable replacements -- even ${workspaceFolder}. See below for more details.
  • This problem only appears in cygwin and works great in cmd.

Cygwin in used like this:
"terminal.integrated.shell.windows": "C:\cygwin\bin\bash.exe",
"terminal.integrated.env.windows": {
"CHERE_INVOKING": "1"
},
"terminal.integrated.shellArgs.windows": [
"--login"
],

The task I am using looks like this:
{
"label": "Get SWC name",
"type": "shell",
"command": ".vscode/get_swc_name.sh",
"args": [
"${relativeFile}"
],
"group": "build",
"options": {
"cwd": "${workspaceFolder}"
},
"presentation": {
"reveal": "never",
"echo": false,
"showReuseMessage": false
}
},
Inside of that shell script I have placed an Echo command to see that the right path was chosen, and that path now comes without slashes.

EDIT: @alexr00 could you please take a look at this again and consider reopening? :)

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 27, 2019
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

5 participants