MrR
MrR

Reputation: 465

Conemu - -reuse an instance, but don't bring it to the foreground

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).

Upvotes: 1

Views: 123

Answers (1)

sbat
sbat

Reputation: 1888

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.

Upvotes: 2

Related Questions