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

cmder integrated terminal task issues #48986

Closed
Nonpareille opened this issue May 1, 2018 · 8 comments
Closed

cmder integrated terminal task issues #48986

Nonpareille opened this issue May 1, 2018 · 8 comments
Assignees
Labels
info-needed Issue requires more information from poster tasks Task system issues

Comments

@Nonpareille
Copy link

Issue Type: Bug

  1. Download cmder from http://cmder.net/ and set as integrated terminal for windows using instructions here https://code.visualstudio.com/docs/editor/integrated-terminal#_common-questions
  2. Create a simple.bat file with @echo this works.
  3. Make a shell task that runs simple.bat as the command.
  4. Run said task.

Actual results:

> Executing task in folder test_project: simple.bat

C:\sandbox\test_project
λ 

Cursor sits there, echo does not happen and the task never completes.

Expected results:

> Executing task in folder test_project: simple.bat

this works

Thoughts:
If we must use the integrated terminal to run tasks, could we have an option to use a different shell for these tasks if they don't play nice with the task system?

VS Code version: Code 1.22.2 (3aeede7, 2018-04-12T16:38:45.278Z)
OS version: Windows_NT x64 10.0.16299

System Info
Item Value
CPUs Intel(R) Core(TM) i7-3770 CPU @ 3.40GHz (8 x 3392)
Memory (System) 15.95GB (7.93GB free)
Process Argv C:\Program Files\Microsoft VS Code\Code.exe
Screen Reader no
VM 0%
Extensions (16)
Extension Author (truncated) Version
language-x86-64-assembly 13x 2.2.11
better-comments aar 1.2.2
vscode-color ans 0.4.5
gitlens eam 8.2.4
vscode-html-css ecm 0.2.0
Go luk 0.6.78
vscode-todo-parser min 1.9.1
python ms- 2018.3.1
cpptools ms- 0.16.1
debugger-for-chrome msj 4.3.0
material-icon-theme PKi 3.3.0
stylelint shi 0.36.0
vscode-hexdump sle 1.6.0
vim vsc 0.11.5
vscode-wakatime Wak 1.2.1
html-css-class-completion Zig 1.17.1
@vscodebot vscodebot bot added the tasks Task system issues label May 1, 2018
@dbaeumer
Copy link
Member

dbaeumer commented May 7, 2018

You can specify a shell to use in the tasks.json file:

{
	"version": "2.0.0",
	"options": {
		"shell": {
			"executable": "cmd.exe",
			"args": [
				"/d", "/c"
			]
		}
	},
	"tasks": [
		{
			"label": "echo",
			"type": "shell",
			"command": "dir"
		}
	]
}

The options can be specified per tasks as well.

Do you know which command line args cmder use to execute a command and then quite (like /d /c for cmd.exe). Then I can add them. As a work around for now you can have the options in the tasks.json point to cmder.exe and use the right options.

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label May 7, 2018
@vscodebot vscodebot bot closed this as completed May 14, 2018
@vscodebot
Copy link

vscodebot bot commented May 14, 2018

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@dbaeumer
Copy link
Member

@nicholasjbbaldwin any information?

@patstew
Copy link

patstew commented May 16, 2018

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"]

@dbaeumer
Copy link
Member

I am a little puzzled. Isn't cmder a standalone executable which supports something like /kor /Citself?

@patstew
Copy link

patstew commented May 17, 2018

There is a cmder executable, but it's a full terminal emulator in its own right that can't be used as the integrated shell. See #12006
I'm not exactly sure how it all works, but AFAIK cmder is using clink.exe as the shell you interact with. It seems that clink.exe expects to be run inside cmd.exe, if you set it as vscode's integrated terminal it exits immediately.

@dbaeumer
Copy link
Member

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.

@vscodebot vscodebot bot locked and limited conversation to collaborators Jun 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster tasks Task system issues
Projects
None yet
Development

No branches or pull requests

3 participants