Cmder: Setting Cmder as default term opens ConEmu instead

Created on 27 Oct 2014  Â·  22Comments  Â·  Source: cmderdev/cmder

If you open the settings for Cmder and set it to be the default terminal, and then go open cmd.exe, it will open ConEmu, not Cmder.

wontfix

Most helpful comment

cmder is sort of ‘boot loader’ for ConEmu.
But due to selected architecture users just can't use several ConEmu functions,
I've already written about them.

So, to solve problems...

  1. No need to pass icon as /icon switch. Just put proper ConEmu.ico into conemu-maximus5 folder.
  2. CMDER_ROOT variable. Of course it's not set on ConEmu.exe startup, but there is ConEmuDir and ConEmuBaseDir, and it would be better to use relative paths with it. For example, /icon "%ConEmuDir%\..\..\cmder.exe" for {cmd} task.

All 22 comments

+1

+1

Wish I had any valuable input. I'd really like this fixed.

I have found a workaround, At Least a non irritation. Add cmdr folder to your PATH and in run type 'cmder'. Two extra characters.

Nice tip!

Just a thought: maybe I can add a symlink named cmd.exe to a PATH with
higher precedence than C:WindowsSystem32 (or wherever cmd.exe is located)
?

(edit: I can't)

On Tue, Jan 6, 2015 at 10:37 AM, Dayanand Prabhu [email protected]
wrote:

I have found a workaround, At Least a non irritation. Add cmdr folder to
your PATH and in run type 'cmder'. Two extra characters.

—
Reply to this email directly or view it on GitHub
https://github.com/bliker/cmder/issues/307#issuecomment-68850326.

Cumprimentos,
Mário Carneiro

http://mariocarneiro.info

That workaround works for manually opening a cmd window, but it won't for any other software opening console windows (for example .bat or .sh files, or any other software starting the process through their code, that we can't change...).

+1

The settings you are talking about are actually settings for ConEMU. ConEMU is the _emulation layer_, not the terminal itself. So when you are doing in reality is setting ConEMU as default (with its default terminal/FAR Manager setup).

The correct way to do this is to create a hard link to Cmder.exe file (or do some very clever hacks). That's possible only through the Windows registry. Look here for a good way to achieve this.

+1

"The settings you are talking about are actually settings for ConEMU. ConEMU is the emulation layer, not the terminal itself. So when you are doing in reality is setting ConEMU as default (with its default terminal/FAR Manager setup).

The correct way to do this is to create a hard link to Cmder.exe file (or do some very clever hacks). That's possible only through the Windows registry. Look here for a good way to achieve this."

It would be nice if instead of having to the the hacks myself, it was integrated into cmder itself.

@wheelerlaw Even though Cmder is just great at what it does, I still wouldn't recommend linking/replacing cmd.exe with Cmder. A lot of things still don't work well with Cmder and terminal emulation. Permissions are another sore point. You wouldn't want cmd.exe missing from your toolbox in those circumstances.

cmder is neither terminal nor shell. So when you start cmder, it just starts ConEmu in turn (which is terminal). So, it's absolutely unclear what you are complaining for.

The wrong xml file location, used by cmder before, raised more problems than you think, and it was fixed. Proper xml file location is inside ConEmu subfolder.

@Maxmaxmaximus What do you really need to replace cmd.exe with Cmder? Applying to specific scenarios is much better, than messing with the registry or doing deep-linked changes.

We can probably just register to that menu at the same time we register the folder r-click handler I'm sure.

I believe it's something to do with C:\Users\$USER\AppData\Local\Microsoft\Windows\WinX, I'm not too sure since I'm not using a Win 10 machine at the moment.

All the shortcuts in win+X are here C:\Users\jbennett\AppData\Local\Microsoft\Windows\WinX

They have registry entries here for some reason HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ShellCompatibility\InboxApp

You can't add your own shortcut here as windows check the hash of these files before displaying them on the start menu. Same goes for just targeting an existing one.

Someone needs to find out how to add new hashes to this wherever the check list is because cmder won't be disabling the hash checking as described here to add new items. I personally won't be disabling that myself ever.

I suspect if anyone does disable the hash checking you should disable windows defender or whatever it's called from scanning that file. Just like when editing your hosts file windows my try changing it back in future.

And the answer would be described here though it looks like Rafael Rivera redesigned the blog and I can't find any of this information anymore.

We could probably just do this directly instead of having to pull in hashlink for what I assume is a rarely used command.

@Jackbennett The blog link worked fine for me, I can see the instructions there.

If a user wants to change it, they can do it themselves, we shouldn't go any further than what's sensible. Conemu can 'replace' conhost (i.e. hook whenever cmd is launched) but it's a global change, it doesn't change the default windows shell shortcuts that a lot of people use (and it shouldn't).

cmder is sort of ‘boot loader’ for ConEmu.
But due to selected architecture users just can't use several ConEmu functions,
I've already written about them.

So, to solve problems...

  1. No need to pass icon as /icon switch. Just put proper ConEmu.ico into conemu-maximus5 folder.
  2. CMDER_ROOT variable. Of course it's not set on ConEmu.exe startup, but there is ConEmuDir and ConEmuBaseDir, and it would be better to use relative paths with it. For example, /icon "%ConEmuDir%\..\..\cmder.exe" for {cmd} task.

@Maximus5

  1. No need to pass icon as /icon switch. Just put proper ConEmu.ico into conemu-maximus5 folder.

This does not change the icon in the taskbar, only in the window. (I guess that is a good thing, because the taskbar icon shows what was originally started)

  1. CMDER_ROOT variable. Of course it's not set on ConEmu.exe startup, but there is ConEmuDir and ConEmuBaseDir, and it would be better to use relative paths with it. For example, /icon "%ConEmuDir%....cmder.exe" for {cmd} task.

This does not work for me at all, the cmder below was started with Win+S->"cmd":
image

@bitbonk

This does not change the icon in the taskbar, only in the window.

False.

2017-01-23_12-46-06

the cmder below was started with Win+S->"cmd":

And why do you think, that ConEmu/cmder/whatever should start init.bat if you asked to run cmd.exe?
Run ConEmu if you want to run the Task you have specified.

I don't know why this is still getting traction,

To round off the discussion;

  1. Cmder is a separate program, not cmd.exe and will not replace it.
  2. Cmder by default wraps cmd.exe so replacing cmd.exe is a terrible idea.
  3. Cmder wraps ConEmu that glues everything together. Hence the icon shenanigans.
  4. There's some extra shortcuts in win+X that could exist but it's more invasive that we choose to be with cmder so it won't get added.

2.5 years I think we'll put this one to bed. Make new issues for things other than the topic of "Setting Cmder as default term opens ConEmu instead"

Thank you @Maximus5 and everyone you're very patient.

I realize this is an old closed issue, but if you're like me, hitting WINKEY+R -> CMD.EXE ->[ENTER] is like a reflex to you. There is a registry key that takes precedence over the %PATH% variable for certain things executed through Windows such as through the Run dialog (or any Windows Address bar, i.e., IE and Windows Explorer). This is why several apps in Windows "just work" without needing to be in the %PATH%.

I've been using this method for years, it's only caused problems once for a small insignificant Visual Studio extension (see below for details).

Whenever I load up a new Windows box, I always add the following keys (add with Regedit or add this to a .reg file and run):

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\cmd.exe]
@="C:\\TEMP\\CMDER\\CMDER.EXE"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\np.exe]
@="C:\\Program Files\\Notepad++\\notepad++.exe"

image

(note, the "np" one is insignificant to this post, but it's just a cool way to alias notepad++ that I thought I would share)

That reg key registers a virtual "cmd.exe" command that takes precedence over C:WindowsSystem32cmd.exe and redirects to cmder.

The ONLY time I ever saw it have a problem was when a Visual Studio extension was launching "cmd.exe" and tried passing in standard Windows cmd.exe arguments, such as "/k" to run a command but leave the window open. It would be nice if cmder.exe and/or conemu.exe had the same args available (or a small proxy app that mapped them over), because then it would truly be a flawless method (from my experience).

So this method should fix anything that uses the Address bar/Run dialog/whatever-internal-windows'y-way-of-resolving-a-command. As far as the Start Menu icon, you can easily just create your own shortcut and replace the included one.

image

The only other thing would be adding it to the beginning of your %PATH% so any bat files and commands from the console get mapped over, but THAT I haven't tested. Probably dangerous if a bat file is using cmd.exe with any arguments.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zsedcbm picture zsedcbm  Â·  3Comments

sathishsoundharajan picture sathishsoundharajan  Â·  3Comments

justinmchase picture justinmchase  Â·  3Comments

Joe1992w picture Joe1992w  Â·  3Comments

GlassGruber picture GlassGruber  Â·  3Comments