Is there are way to have ConEmu.exe run a command, e.g. cd some/pathon the active console?

To provide more context, I am attempt to integrate Total Commander (an external file explorer application) with ConEmu. On Total Commander, I define a start menu item (similar to Macros in Conemu) to execute ConEmu.exe like so:

 ConEmu.exe -Reuse -Dir %P

where %P is a parameter in Total Commander value of which is path of the current pane. This works as documented, reuses single ConEmu session or opens one up if none running, and creates a new tab with the default task whose CD is %P (my default task happens to be Git Bash).

To get the same effect on an existing tab, whichever one happens to be active, I attempted:

ConEmu.exe -Reuse -run ConEmuC -GuiMacro print cd %P

but that doesn't quite work.

Is there a way to get this effect?


When you try to run yours ConEmu.exe -Reuse -run ConEmuC -GuiMacro print cd %P, the ConEmuC is started in the new tab of the existing ConEmu window. So, you macro is trying to be executed in that new tab.

Instead, you shall try to run simple

ConEmuC -GuiMacro print cd %P

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.