cmder: make a new tab open in the directory of the already-open tab

16

5

When I press Ctrl+T to open a new tab in Cmder, I want the new tab to open in the same directory as the old tab (the tab that I was in, when I hit Ctrl+T).

This will avoid a lot of cd commands in the new tab, to get to the same working directory as the old tab.

gsi-frank

Posted 2015-05-09T15:36:19.767

Reputation: 1 024

Answers

16

As explained by @Maximus here and also in another question, a nice way to do this is to bind

Shell("new_console:I")

to a GuiMacro hotkey.

In cmder/ConEmu, go to Settings|Keys&Macro. Then click the Macros radio button on the top right and then add a new macro for Shell("new_console:I") and bind it to whatever key combination (hotkey) you want.

Add New Macro with HotKey

So in my case (see screenshot above) pressing Win+Ctrl+d creates a new tab in the same directory as the current tab (i.e. duplicates the current tab). Have been searching for how to do this for ages, so I thought it was worth an answer instead of just a comment.

And yes, I can confirm that this works perfectly fine in cmder (tested in v1.2), as cmder uses ConEmu under the hood.

Thanks to @Maximus.

nonbeing

Posted 2015-05-09T15:36:19.767

Reputation: 339

5new_console:I doesn't open in the same path for me. ConEmu 151115 [64] – rofrol – 2015-12-25T00:28:21.653

1Just what I needed. – Alex Booker – 2016-01-10T16:15:40.163

@rofrol Check http://superuser.com/a/942854/216090 for how to open the new tab in the same path as current tab.

– nachtigall – 2016-08-16T12:06:54.453

2new_console:I does work for me in ConEmu – jiminikiz – 2017-01-24T15:51:09.913

1

In ConEmu you can call "Duplicate root" from TabMenu and you may choose any desired hotkey on the Keys & Macro Settings page.

BTW, you may split (to right/bottom) your active tab.

Maximus

Posted 2015-05-09T15:36:19.767

Reputation: 19 395

Can you please explain how this is used?  Can it be mapped to a shortcut key? — the OP is explicitly trying to reduce tedious typing.  Do you know whether this works in Cmder? – G-Man Says 'Reinstate Monica' – 2015-05-09T19:38:24.360

cmder IS ConEmu. OP may set up any desired hotkey to this action. – Maximus – 2015-05-09T22:20:40.527

2How I can call "Duplicate root", what is that? Can you be a little more details for a poor Cmder mortal ;) – gsi-frank – 2015-05-09T23:47:54.720

Some more details and links. – Maximus – 2015-05-10T18:05:17.713

this worked for me http://superuser.com/a/935109/64577

– rofrol – 2015-07-31T17:15:41.000