-
Notifications
You must be signed in to change notification settings - Fork 2k
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
VSCode tasks don't run properly on Cmder #1985
Comments
@eparizzi what you are seeing is cmder debug output normally enabled using the |
My VS Code integrated settings are: "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
"terminal.integrated.shellArgs.windows": [
"/k",
"%CMDER_ROOT%\\vendor\\init.bat"
],
The terminal works fine by using it normally. It just doesn't work when running a VS Code task. |
i have encountered the same problem. wondering if it has been solved? |
Vscode is feeding in an argument that init.bat is seeing as a '/d' See the references PR fir a workaroind |
BTW, the reason for this issue has been explained by @patstew here:
|
First of all, thank you for referring me the post.
but sorry, the answer from patstew is quite hard to understand for me.
("The problem is ?.... vscode documentation recommends?", ps. i am not a
native english speaker.)
Moreover, I can not understand the solution, too. "end up an arguments
array like ["/K", "C:\\cmder\\vscode.bat", "&", "task_command", "task_arg"]".
Does it mean arguments in my tasks.json? In my case, my command in
tasks.json is a python. then, the args would be args for python, it should
be wrong.
I can understand what caused this problem, "OK. Now I see. This is
currently not possible since a tasks already passes a command to the
cmd.exe. It would require that we add special code for cmder.exe that
injects the vscode.bat into the command when executing." from dbaeumer. (
microsoft/vscode#48986 (comment))
Thank you again.
David Refoua <notifications@github.com> 于2019年3月9日周六 下午8:54写道:
… BTW, the reason for this issue has been explained by @patstew
<https://github.com/patstew> here:
microsoft/vscode#48986 (comment)
<microsoft/vscode#48986 (comment)>
The problem is that the VS Code documentation recommends doing this to
start cmder:
"terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\cmd.exe","terminal.integrated.shellArgs.windows": ["/K", "C:\\cmder\\vscode.bat"]
and you can only have one /K or /C, so appending another one to do the
task doesn't work. You'd need to to end up with an arguments array like:
["/K", "C:\\cmder\\vscode.bat", "&", "task_command", "task_arg"]
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1985 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AnBRq1kpuSPgEHG9P4OMwU5bMOO3GRZRks5vU68EgaJpZM4ZQ7kx>
.
|
@hyc0612 Sorry if my comment was unclear. Basically, this means that a fix should be made to VS Code in order to make tasks work. Unfortunately, there is no solution that you can use right now to make it work; instead the creators of VS Code and us should work on something to fix the problem. Please wait while we work on either a fix or a workaround for this issue. 😉 |
I had the same issues with cmder, couldn't get any of the supposed workarounds to actually work, finally got shark (a fork of cmder), it seems to be running fine. The config needed is the following:
|
@kamenminkov are you launching a shell using shark or are you running a task via vscode using shark? Shell should work the same with shark and cmder. Tasks should fail in both based on Microsoft/vscode#48986 (comment)). The failure on shark though should be different than what is reported here. Instead of all the debug messages reported by cmder users the task would just not run at all. |
@daxgames Sorry, my bad, ignore my previous comment; I was not launching tasks through the native VSCode feature but by using Quick Task. Shark and cmder differ (for me at least) only by that cmder outputs all that debug info before showing the prompt (shark shows the prompt right away); both shark and cmder seem to break the task the moment the prompt is initialised. I suppose it's a matter of how (in what order) the arguments are passed to cmd.exe. |
@kamenminkov you are experiencing exactly as I thought but explained poorly |
There is a hacky way to get tasks to work. As by default using the Cmder shell with tasks will fail. However, in the associated tasks.json file, we can override the VSCode shell and default behaviour for tasks, and have Cmder initialized a bit more manually:
This, when placed in the |
@StableCoder This works if I disable the "terminal.integrated.shellArgs.windows" setting, which defeats the whole purpose - if I want to open a new terminal without a task, it opens a bare cmd. I wouldn't mind bare cmd for tasks themselves. |
I could not make it work. My option was to create a script in bash and put the git-bash that comes in the cmder as the default terminal. I had to run rsync. |
Yes. I just re-tested in 1.33.1, and it works fine. This is my whole
Again, specifying it in the |
What works for me is just specifying
... and instead of using the
I have
This even works to start tasks at project open. What doesn't always work is interrupting the task with |
Thank you ! I'll take your example and test. |
Got the Cmder now runs tasks normally without any issues for me |
@ajaymittur28 , i created |
would this work even if the shell for vs code is set to powershell, together with cmder ? |
@a4z , its uses cmd.exe for starting vscode_init.cmd, if it has arguments -> run these commands (using cmd.exe), if it has no arguments -> run vendor\init.bat |
I experienced the same problem. I am forced to remove the cmder integration from vscode to do debugging |
already have a solution |
I've followed the instructions here and I'm able to run Cmder as VSCode integrated terminal.
Everything seems to be working fine, except for VSCode > Run Task which ouputs a lot of stuff but doesn't run the task.
Example:
VSCode > Terminal > Run Task > npm start
Integrated terminals shows:
Not sure if a bug in VSCode, cmder or in the integration between the two.
The text was updated successfully, but these errors were encountered: