Open new ConEmu tab with the same working directory

1

I have a ConEmu macro for Ctrl+T which runs Task("Powershell"). My Powershell task just runs powershell with the argument \dir %userprofile%.

The Macro tab in "About ConEmu" says that the Task command can take a second argument for the directory:

Task("Name"[,"Dir"])
- start task with specified name

I'd like to make my macro open a new tab with the same working directory as the tab I'm looking at when I hit Ctrl+T. Is this possible?

JamesGecko

Posted 2013-09-19T19:34:25.030

Reputation: 1 582

Answers

1

When you "CD" in powershell, it does not actually change current process directory (SetCurrentDirectory is not called). You may check this with ProcessExplorer for example.

So, you may run from your active powershell prompt

PowerShell -new_console

or do that with GuiMacro. Using GuiMacro you can set any desired hotkey for that action.

Print("\ePowerShell -new_console\n")

In theory, you may create new tab without using active powershell prompt, there is another macro, but you need to force your PowerShell to call SetCurrentDirectory explicitly. For example, you may override your prompt function in powershell profile.

Maximus

Posted 2013-09-19T19:34:25.030

Reputation: 19 395