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

Using the context menu doesn't open a new tab in Single Instance Mode #356

Closed
alexilyaev opened this issue Dec 21, 2014 · 31 comments
Closed

Comments

@alexilyaev
Copy link

With Appearance > Single Instance Mode checked...
Using Cmder Here in the context menu opens correctly for the first time, but when trying again in another folder, it does not add a new tab to Cmder, it just focuses the existing tab.

Unchecking Single Instance Mode works as expected with new windows each time.

This worked ok with ConEmu Here.

I guess it's something that has to do with init.bat or the default {cmd} task, but I couldn't figure it out.

Tested on Win 7 and Win 8.1.

@Zequez
Copy link

Zequez commented Dec 26, 2014

Glad I'm not the only one that noticed this, I thought I messed up something.

Not sure if related, but I'm fairly sure this was working before, and now I updated from Win7 to Win8.1.

@77cc33
Copy link

77cc33 commented Jan 3, 2015

I have the same issue in quake mode & single instance on windows 7 x64 bit

some fix would be nice

@ticklemynausea
Copy link

I have the same issue. Could not fix it.

@stavfx
Copy link

stavfx commented Apr 28, 2015

Has anyone found a workaround? really missing this feature...

@TimNN
Copy link

TimNN commented Aug 25, 2015

I'm currently using the following workaround:

Create workaround.bat next to Cmder.exe with the contents:

@echo %1 > "%~dp0\CMDER_CD"
@"%~dp0\Cmder.exe" /SINGLE

Use regedit to edit the registered context menu entry (search for "Cmder") and replace "Cmder.exe" with "workaround.bat" in the entry of the command folder.
sicpa-net_chl0112383_20150825_095454_tneumann_registry editor

Then add the following to init.bat in the vendor directory of your cmder installation:

@if not exist "%CMDER_ROOT%\CMDER_CD" (
    @goto ENDCD
)

@set /p CMDER_CD= < "%CMDER_ROOT%\CMDER_CD"
@del "%CMDER_ROOT%\CMDER_CD"

@cd /d %CMDER_CD%

:ENDCD

You'll notice a standard cmd window opening and closing when you "Cmder here" which you could workaround by replacing workaround.bat with a vbscript, put for me this is good enough.

Obviously, if you are using powershell, you'll need to port the part added to init.bat to you powershell initialization file.

@WangJi
Copy link

WangJi commented Nov 23, 2015

@TimNN
I tried your way. It works. Thank you for sharing.
I'd wish DevTeam see this and fix it, though.

@MartiUK
Copy link
Member

MartiUK commented Nov 23, 2015

@WangJi We know about it, try the latest pre-release

@MadLittleMods
Copy link

👍

This doesn't seem to be working in the latest pre-release for me v1.2.9 with Appearance > Single Instance Mode checked or /single parameter in shortcut.

Or perhaps I am misunderstanding what this option is supposed to do. I expect this to only show a single instance in the task bar (no stacking). Similar to the option for Internet explorer.

Related to #525 and maybe #197

@MartiUK
Copy link
Member

MartiUK commented Dec 7, 2015

Strange, it's working for me...

My target for the shortcut is [...]\cmder\Cmder.exe /single when I repeatedly middle mouse click on it (in the taskbar) it opens multiple tabs in a single instance.

@TimNN
Copy link

TimNN commented Dec 7, 2015

@MadLittleMods I haven't used cmder in a while so I may be wrong, but I think you are misunderstanding something: The single options means that instead of opening a new window, a new tab is opened. This does not change cmder's behaviour of displaying separate previews for each tab, which I think it does anyway.

@MadLittleMods
Copy link

@TimNN I split out the stacking/preview disabling into a new issue: #758

@Ydiren
Copy link

Ydiren commented Dec 11, 2015

I've changed the registry entry for "Cmder here" to "C:\Cmder\Cmder.exe" /single "%V" and each command prompt opens in a new tab. The only problem is that each tab is opened in the same directory as the first tab, no matter which directory I select "Cmder here" in.

@agibson-fl
Copy link

With Appearance > Single Instance Mode checked...
Using Cmder Here in the context menu opens correctly for the first time, but when trying again in another folder, it does not add a new tab to Cmder, it just focuses the existing tab.

I'm having this same problem using release 1.2.9

@MartiUK
Copy link
Member

MartiUK commented Dec 16, 2015

Working on it: #772

@Jackbennett
Copy link
Contributor

@MartiUK Looks like you've merged and closed things this references are you happy to close his too?

@MartiUK
Copy link
Member

MartiUK commented May 25, 2016

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Yeah go for it.

On 25 May 2016 11:36:21 BST, Jack notifications@github.com wrote:

@MartiUK Looks like you've merged and closed things this references
are you happy to close his too?


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#356 (comment)


Sent from my Android device with K-9 Mail. Please excuse my brevity.
-----BEGIN PGP SIGNATURE-----

iQE+BAEBCgAoIRxNYXJ0aW4gS2VtcCA8bWFydGluQG1hcnRpbmtlLm1wPgUCV0WA
YAAKCRBxKFXOM3nEdc+DB/9OPqWkQj9g062hNAC5+r6ItADAzFbdZ05W/hUfnrbZ
X1eSRSGH1gYZ1soXIuQDt5aIhbuVXoQFdM6/G3uBTC84mXsHEQPTWLulTK2B9cng
tXNLUfWs/uHP2Woy9vPmwpedc3I/MfGWub8ahFPUUm9EKNhnq18QIfcUm19QAoBI
ufhLvm+Mu2lKSWo4e0A5Rt0ALiNOR9ZhR9GU9P4MgonBidya1YRmUHGkl/8eNahQ
hvGP7nz20nzkCc59wPXG/d5BFhZVZlqAGNaWqGKPfJtJw8EwHkR8UgIbM+/j5MXE
mJABtDIoXTz+gPhiqdjvfAc4WYAf7qZCkEp7a4Ki9MyH
=2O9d
-----END PGP SIGNATURE-----

@ghost
Copy link

ghost commented Jul 25, 2016

I don't think this is actually fixed? I'm having the exact same problem on 1.3.0.

@WangJi
Copy link

WangJi commented Jul 27, 2016

@rainyday No, it's not fixed. Only the first tab can be opened in single instance mode.

@ChristopheMayet
Copy link

Here my workaround, after registered "ConEmu here" :

  1. Open regedit, go to HKEY_CLASSES_ROOT > Directory > Background > shell > Cmder here > command (I named it "Cmder here" instead of the default "ConEmu here")
  2. Change the entry for "[Path to Cmder]\Cmder.exe" /SINGLE "%V". It will open, at the first call, on the right current directory. However all "Cmder here" calls after will only have the same directory from the first tab, no mater from where you call it (as reported here).
  3. Change the default task in Cmder settings Startup > Tasks to cmd /U /K "set CMDER_START=%cd% & %ConEmuDir%\..\init.bat" -new_console:n and check "Default task for new console" setting.

As in the ini.bat, if we defined a CMDER_START environment variable, it will cd on this directory (in where the click happens).
No need to modify files so the update will not replace them.

But this is a workaround, Cmder.exe should be fixed to have consistent behavior.

@Hugo-KTM
Copy link
Contributor

Hugo-KTM commented Sep 6, 2016

I use 1.3.0 as a restricted user and the workaround by @MrKuja does not work for me.
I tried to pass CMDER_START to Cmder.exe via cmd.exe /s /c set CMDER_START="%V" & Cmder.exe /SINGLE "%V" but that did not work either.

@quericy
Copy link

quericy commented Sep 7, 2016

@MrKuja I use your solution at the version 1.3.1 , but it still only have the same directory from the first tab.

@Jackbennett
Copy link
Contributor

rounding up another /single issue onto #420

@kofifus
Copy link

kofifus commented Jun 21, 2017

This is still not working for me,
I tried with both cmder 1.3.2 and by building the github head

  • I tick Single instance mode
  • In the registry for Computer\HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder\command I set "C:\cmder\Cmder.exe" /SINGLE "%V"
  • I then try a directory right click -> Cmder here
  • Also tested from a cmd.exe to do "c:\cmder\Cmder.exe /SINGLE "c:\Temp"

I get a new tab in the (single) window but it does not change directory

Any help ?

@jdhao
Copy link

jdhao commented Dec 3, 2018

I have also met this issue. I find that if you use quake-style slide down option, then when you use "cmder here", the new tab will be opened on current window instead of a new one.
image

I am using the latest cmder.

@michidk
Copy link

michidk commented Dec 26, 2018

Still does not work. Settings Quake style slide down to true, also didn't fix the issue.

@daxgames
Copy link
Member

@michidk have you tried cmder /register /single?

@michidk
Copy link

michidk commented Dec 26, 2018

@daxgames yep. also did '/register all'. If Cmder is closed, it works for the first tab. But if one tab is already open, I can't use 'Cmder Here' anymore. Works with the ConEmu shortcuts though, which can be registered in the settings.

@daxgames
Copy link
Member

@michidk /register all does not honor /single unless you do /register all /single same thing for /register user /single.

I wrote this support so I know it worked on my system. I will need to test it again.

@myounus96
Copy link

I have also met this issue. I find that if you use quake-style slide down option, then when you use "cmder here", the new tab will be opened on current window instead of a new one.
image

I am using the latest cmder.

Works like a charm.Thanks man

@myounus96
Copy link

@michidk /register all does not honor /single unless you do /register all /single same thing for /register user /single.

I wrote this support so I know it worked on my system. I will need to test it again.

It works,Thanks.

@diablov
Copy link

diablov commented Feb 28, 2023

/register all /single

works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests