python - Conemu - 重用实例,但不将其带到前台

标签 python windows python-3.x conemu

Windows 8.1、ConEmu 170316 [32] {预览}

我从 python 中调用它:

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)

当前正在将实例带到前台,这是不希望的。 如果我将 -Reuse 从等式中剔除,所有内容都会保留在后台(在新的 conemu 实例中创建单个选项卡)。

最佳答案

显然,您可以使用 GuiMacro 控制现有的 ConEmu 窗口,而无需将其带到前台,如下所示:

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

更多信息请点击:https://conemu.github.io/en/GuiMacro.html

如果 ConEmu 尚未运行,您将必须启动它。

关于python - Conemu - 重用实例,但不将其带到前台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45442380/

相关文章:

python - Nvidia Jetson 上的 Tensorflow Lite

java - 从pyspark手动调用spark的垃圾回收

windows - 如何移动到某个选项卡上某个窗口中存在的非隐藏缓冲区?

python - 从字符串中删除数字,同时保留字母数字单词

python - 在 setup.cfg 中正确使用 PEP 508 环境标记

Python 3.1.3 Win 7 : csv writerow Error "must be bytes or buffer, not str"

python - 从soapui运行selenium python测试来读取文件

python - Django 中的子域问题

c# - 使用桌面应用程序在 Windows 10 上通知

c++ - 如何在 Windows 中创建线程安全的单例模式?