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

Documentation for running a Cygwin shell causes build to fail #75945

Closed
Ben-Voris opened this issue Jun 22, 2019 · 5 comments · Fixed by #76250
Closed

Documentation for running a Cygwin shell causes build to fail #75945

Ben-Voris opened this issue Jun 22, 2019 · 5 comments · Fixed by #76250
Assignees
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code terminal Integrated terminal issues windows VS Code on Windows issues
Milestone

Comments

@Ben-Voris
Copy link

Following the instructions for setting "terminal.integrated.shellArgs.windows" given at https://code.visualstudio.com/docs/editor/integrated-terminal#_can-i-use-cygwins-shell-with-the-terminal-on-windows
causes run build task using Cygwin to fail with:

cygpath: option requires an argument -- c
Try `cygpath --help' for more information.

A task window opens and shows a bash prompt. make runs correctly at that
prompt.

run build task correctly runs Cygwin make after removing
"terminal.integrated.shellArgs.windows".

Using Cygwin Shell says:

add the following settings to your settings.json file:

"terminal.integrated.shell.windows": "C:\\Cygwin\\bin\\bash.exe",
"terminal.integrated.shellArgs.windows": ["/bin/xhere", "/bin/bash"]

xhere takes one or two arguments: a program to start and an optional
directory to make the cwd before starting the given program.

This problem occurs because, when executing run build task, VS Code
passes three arguments: the Cygwin path name of the Windows path given in
"terminal.integrated.shell.windows", a literal -c, and , as one
argument, the value of "command" and the "args" array from tasks.json. For
example, when running all from this tasks.json:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "all",
            "type": "shell",
            "command": "C:/cygwin64/bin/make.exe",
            "args": [
                "all"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": [
                "$gcc"
            ]
        }
    ]
}

arg 1: /bin/bash
arg 2: -c
arg 3: C:/cygwin64/bin/make.exe all

It appears that VS Code changes the current work directory before starting
"terminal.integrated.shell.windows" which would make xhere unnecessary. If
that is so, the fix would be to change the text of
https://code.visualstudio.com/docs/editor/integrated-terminal#_can-i-use-cygwins-shell-with-the-terminal-on-windows
to say that "terminal.integrated.shellArgs.windows" need not be set,
along with a warning that it must not contain -l or --login as they
reset the cwd to the user's home directory.

Version: 1.35.1 (system setup)
Commit: c7d83e57cd18f18026a8162d042843bda1bcf21f
Date: 2019-06-12T14:30:02.622Z
Electron: 3.1.8
Chrome: 66.0.3359.181
Node.js: 10.2.0
V8: 6.6.346.32
OS: Windows_NT x64 10.0.16299

Problem occurs with all extensions disabled.

If I clear "Dev Tools Console" before run build task, it displays nothing
new after running run build task.

VS Code version: Code 1.35.1 (c7d83e5, 2019-06-12T14:30:02.622Z)
OS version: Windows_NT x64 10.0.16299

System Info
Item Value
CPUs Intel(R) Core(TM) i7-6820HQ CPU @ 2.70GHz (8 x 2712)
GPU Status 2d_canvas: enabled
checker_imaging: disabled_off
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
rasterization: enabled
surface_synchronization: enabled_on
video_decode: enabled
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.88GB (8.22GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (9)
Extension Author (truncated) Version
spellright ban 3.0.38
remote-containers ms- 0.59.0
remote-ssh ms- 0.42.2
remote-ssh-edit ms- 0.42.2
remote-ssh-explorer ms- 0.42.2
remote-wsl ms- 0.38.0
vscode-remote-extensionpack ms- 0.15.0
cpptools ms- 0.24.0-insiders
rewrap stk 1.9.1
@vscodebot vscodebot bot added the terminal Integrated terminal issues label Jun 22, 2019
@Tyriar
Copy link
Member

Tyriar commented Jun 27, 2019

You're right, it looks like cygwin just works without the args stuff now. Because of this I think we should just expose it in the default shell selector now using the standard install paths instead of having the FAQ.

@Tyriar Tyriar added feature-request Request for new features or functionality windows VS Code on Windows issues labels Jun 27, 2019
@Tyriar Tyriar added this to the July 2019 milestone Jun 27, 2019
Tyriar added a commit that referenced this issue Jun 27, 2019
@Tyriar
Copy link
Member

Tyriar commented Jun 27, 2019

Screen Shot 2019-06-27 at 8 34 03 AM

Tyriar added a commit to microsoft/vscode-docs that referenced this issue Jun 27, 2019
@Tyriar Tyriar added the verification-needed Verification of issue is requested label Jul 29, 2019
@alexr00
Copy link
Member

alexr00 commented Jul 31, 2019

It looks like there is still some additional setup needed. I can't just change the shell to cygwin:
cygwin

@alexr00 alexr00 added the verification-found Issue verification failed label Jul 31, 2019
@alexr00 alexr00 reopened this Jul 31, 2019
@Tyriar Tyriar removed verification-found Issue verification failed verification-needed Verification of issue is requested labels Jul 31, 2019
@Tyriar Tyriar modified the milestones: July 2019, Backlog Jul 31, 2019
@Tyriar
Copy link
Member

Tyriar commented Jul 31, 2019

Removing cygwin detection for now, it looks like it needs needs args which is an area the shell detector doesn't touch yet. The old instructions don't seem to work, something must have changed in cygwin https://www.fesevur.com/2017/11/cygwin-terminal-in-vscode.html

Hoping someone in the community will put together some instructions that we can update the documentation with. I'll remove the doc entry completely for the time being.

Tyriar added a commit to microsoft/vscode-docs that referenced this issue Jul 31, 2019
@Tyriar Tyriar added the *out-of-scope Posted issue is not in scope of VS Code label Oct 9, 2019
@vscodebot
Copy link

vscodebot bot commented Oct 9, 2019

This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider.

If you wonder what we are up to, please see our roadmap and issue reporting guidelines.

Thanks for your understanding and happy coding!

@vscodebot vscodebot bot closed this as completed Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality *out-of-scope Posted issue is not in scope of VS Code terminal Integrated terminal issues windows VS Code on Windows issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants