run commands in active console via command line ConEmu.exe

0

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?

sly

Posted 2016-11-24T18:45:33.537

Reputation: 103

Answers

0

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

Maximus

Posted 2016-11-24T18:45:33.537

Reputation: 19 395