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

Setting Cmder.exe as integrated shell still opens in separate window #12006

Closed
jjacode opened this issue Sep 14, 2016 · 14 comments
Closed

Setting Cmder.exe as integrated shell still opens in separate window #12006

jjacode opened this issue Sep 14, 2016 · 14 comments
Assignees
Labels
*duplicate Issue identified as a duplicate of another issue(s) terminal Integrated terminal issues

Comments

@jjacode
Copy link

jjacode commented Sep 14, 2016

  • 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.
@weinand weinand added the terminal Integrated terminal issues label Sep 14, 2016
@weinand weinand assigned Tyriar and unassigned weinand Sep 14, 2016
@Tyriar
Copy link
Member

Tyriar commented Sep 14, 2016

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 Tyriar closed this as completed Sep 14, 2016
@Tyriar Tyriar added the *duplicate Issue identified as a duplicate of another issue(s) label Sep 14, 2016
@jjacode
Copy link
Author

jjacode commented Sep 15, 2016

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

@popey456963
Copy link

@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",

@JCMais
Copy link

JCMais commented Apr 20, 2017

@popey456963 worked perfectly here. Thank you.

@jjacode
Copy link
Author

jjacode commented Apr 20, 2017

@popey456963 Thanks! That worked for me as well!

@Jarvid
Copy link

Jarvid commented May 22, 2017

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.

@thinkOfaNumber
Copy link

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

@Morkowski
Copy link

Morkowski commented Jun 15, 2017

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.

@johnkors
Copy link

johnkors commented Jul 13, 2017

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

@kemotoe
Copy link

kemotoe commented Jul 15, 2017

@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

@johnkors
Copy link

Confirmed working! Thanks, @kemotoe !

@Cipfahim
Copy link

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

@Tyriar
Copy link
Member

Tyriar commented Jul 17, 2017

Locking so solutions don't get buried.

@microsoft microsoft locked and limited conversation to collaborators Jul 17, 2017
@Tyriar
Copy link
Member

Tyriar commented Sep 12, 2018

Updates:

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) terminal Integrated terminal issues
Projects
None yet
Development

No branches or pull requests