简体   繁体   English

具有添加命令的Conemu任务

[英]Conemu Task with Added Command

I'm trying to add a command to the startup tasks in ConEmu that is invoked in Git Bash. 我试图将命令添加到ConEmu中的启动任务中,该命令在Git Bash中调用。 I found a similar post that appears to suggest that I can do this, but when I try this it doesn't work and tells me /k or /c is not a file or directory, also it appears to use cmd and I'd like to run this in bash not the command prompt. 我发现了一个类似的帖子 ,似乎暗示我可以执行此操作,但是当我尝试执行此操作时却不起作用,并告诉我/ k或/ c不是文件或目录,它似乎也使用了cmd,并且我想喜欢在bash中运行此命令,而不是在命令提示符下运行。 Is it possible to set this in a task using ConEmu Git Bash? 是否可以使用ConEmu Git Bash在任务中进行设置? Something like this that opens up three consoles and begins invoking a couple commands in two of them: 这样的事情打开了三个控制台,并开始在其中两个中调用几个命令:

%ConEmuDir%\..\Git\bin\sh.exe --login -i 
-new_console:C:"%ConEmuDir%\..\Git\etc\git.ico" 
-cur_console:t:"APP" 
-cur_console:d:D:/projects/mycurrentproject

%ConEmuDir%\..\Git\bin\sh.exe --login -i 
-new_console:C:"%ConEmuDir%\..\Git\etc\git.ico" 
-cur_console:s50H 
-cur_console:t:"GIT" /k "git status"

%ConEmuDir%\..\Git\bin\sh.exe --login -i 
-new_console:C:"%ConEmuDir%\..\Git\etc\git.ico" 
-cur_console:s50V 
-cur_console:t:"Homestead" /k "homestead up"

Your question is not related to ConEmu. 您的问题与ConEmu无关。 Bash has no switch to run commands and leave interactive shell running. Bash没有开关来运行命令并保持交互式外壳运行。

The only workaround I know is to set some environment variable to the desired list if commands and and corresponding lines checking and executing it to your profile script. 我知道的唯一解决方法是,如果命令和相应的行检查并执行了您的配置文件脚本,则将一些环境变量设置为所需的列表。

The same question with some examples is here: https://superuser.com/a/344486/139371 带有一些示例的相同问题在这里: https : //superuser.com/a/344486/139371

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM