1

Windows 8.1 , ConEmu 170316 [32] {Preview}

I invoke it from python with:

command = [
  "o:\PAR\ConEmu\ConEmuPortable.exe",
  "-Reuse",
  "-Min",
  "-run", 
  "o:\PAR\PortableGit-2.7.0-64-bit\git-cmd.exe",
  "--no-cd",
  "--command=/usr/bin/bash.exe",
  "-l",
  "-i", 
  # full path to bash file to execute in git-bash on windows e.g. cd to repo
  absfilepath,
  # basename is the script name so that the tab is named after it
  "-cur_console:t:{}".format(basename)
]
subprocess.call(command)

This is currently taking the instance to the foreground which is undesired. If I take -Reuse out of the equation everything stays in the background (creates a single tab in a new conemu instance).

MrR
  • 411
  • 5
  • 12
  • 1
    [@Maximus](https://stackoverflow.com/users/1405560/maximus) Do you happen to have any inputs on this by any chance? – MrR Aug 14 '17 at 23:13

1 Answers1

2

Apparently you can control existing ConEmu window with GuiMacro without bringing it to the foreground like this:

conemuc -GuiMacro:0 shell("new_console:b","","cmd.exe /k")

More info here: https://conemu.github.io/en/GuiMacro.html

You will have to launch ConEmu though if it is not running yet.

sbat
  • 1,453
  • 10
  • 21