Vscode: Setting Cmder.exe as integrated shell still opens in separate window

Created on 14 Sep 2016  Ā·  14Comments  Ā·  Source: microsoft/vscode

  • VSCode Version: 1.5.2
  • OS Version: Windows 10

Steps to Reproduce:

  1. In user settings add "terminal.integrated.shell.windows": "C:\\Program Files (x86)\\cmder\\Cmder.exe",
  2. Press ctrl + backtick
  3. Notice Cmder opens in separate window after trying to open in integrated spot.
*duplicate integrated-terminal

Most helpful comment

This approach is only running the git bash and missing some of cmders settings. Giving me some problems with the the codeset and other things. If you want the full cmder shell as you are used to, set the following in the settings(of course adapt you paths and choose the 32bit cmd.exe if required):

"terminal.integrated.shell.windows": "C:\\WINDOWS\\sysnative\\cmd.exe", "terminal.integrated.shellArgs.windows" : ["/K","C:\\cmder\\vendor\\init.bat"]

Thanks a lot @thinkOfaNumber.
Without his post in http://stackoverflow.com/questions/43363254/in-visual-studio-code-how-do-you-inject-clink-into-the-integrated-terminal I would never have known, I have to pass the arguments in this way.

All 14 comments

cmder is a full-blown terminal emulator, not a psuedo terminal/shell which is what you need to specify there. Think of it that cmder is basically what the VS Code integrated terminal is, you cannot attach VS Code's integrated terminal to cmder for example. So this is a duplicate of #6935

I think Clink is cmder's underlying shell, however I believe there are some issues with using Clink and git bash which make it less than ideal such as #7345

@Tyriar, thank you for that explanation. That makes more sense.

@Tyriar @jjacode Reference the bash executable within Cmder and you appear to get the full Cmder shell, for example:

terminal.integrated.shell.windows": "C:\\Users\\Popey\\Downloads\\Cmder2\\vendor\\git-for-windows\\bin\\bash.exe",

@popey456963 worked perfectly here. Thank you.

@popey456963 Thanks! That worked for me as well!

This approach is only running the git bash and missing some of cmders settings. Giving me some problems with the the codeset and other things. If you want the full cmder shell as you are used to, set the following in the settings(of course adapt you paths and choose the 32bit cmd.exe if required):

"terminal.integrated.shell.windows": "C:\\WINDOWS\\sysnative\\cmd.exe", "terminal.integrated.shellArgs.windows" : ["/K","C:\\cmder\\vendor\\init.bat"]

Thanks a lot @thinkOfaNumber.
Without his post in http://stackoverflow.com/questions/43363254/in-visual-studio-code-how-do-you-inject-clink-into-the-integrated-terminal I would never have known, I have to pass the arguments in this way.

You're welcome, thanks for the attribution! Feel free to upvote the SO post if you think it's useful ;-)

There is also different trick - opening your text editor in cmder ;) https://medium.com/@WMorkowski/protip-integrating-cmder-with-text-editor-7f08a6e76de7

from article:

  1. Run your cmder.
  2. Go to ā€˜Settings -> Startup -> Environment’
  3. Type: set EDITOR_PATH=C:\Program Files (x86)\Microsoft VS Code\Code.exe alias editor="%EDITOR_PATH%" $1 -new_console:s50V Where
    in the first line you should type path to your text editor (I was
    testing it on Visual Studio Code and Sublime, but it should work with
    other editors).
  4. Save your settings
  5. Type ā€˜editor’ command in command line.

Whoa! We almost finished. But in most cases you don’t want console tab
to be attached to the top of the window. You should close console tab,
and open it again, paying attention to check ā€œNew console split to
bottomā€ checkbox and choose the right console type. Now when you
finally set everything up, you should go to ā€˜Settings -> Startup’, and
check ā€œAuto save/restore opened tabsā€ checkbox to save our new
workflow. Now every time you run cmder, your tabs setup will be
restored.

I only get cmder / clink to work OK inside Code if I launch Code from cmder. Launching Code directly and navigating to the integrated terminal just gives me Clink errors. Any idea..? Looks like the path to clink is wrong somehow when launching Code directly from the start menu.

Terminal output when launching Code

Generating clink initial settings in C:\config\settings
Additional *.lua files in C:\config are loaded on startup.
The system cannot find the path specified.
Creating intial aliases in C:\config\aliases
File not found - C:\config\aliases

@johnkors I was having the same problem. Create a file in the root of your cmder folder "whatever".bat. I named mine vscode.bat. With the following code.
@echo off
SET CMDER_ROOT=C:\cmder (your path to cmder)
"%CMDER_ROOT%\vendor\init.bat"

Then in your vscode settings add the following to your settings.json

"terminal.integrated.shell.windows": "C:\\WINDOWS\\sysnative\\cmd.exe",
"terminal.integrated.shellArgs.windows": ["/K", "C:\\cmder\\vscode.bat"]

Works perfect for me now

Confirmed working! Thanks, @kemotoe !

@popey456963 Thank you man :) it's working.

Locking so solutions don't get buried.

Updates:

Was this page helpful?
0 / 5 - 0 ratings