ConEmu commands in task

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 09:39:15

问题


I'm trying to get a Task in ConEmu to open several consoles, and for each run a batch-like script when opened. For example:

  • Open a Git Bash, name the console "X", set the current directory to "Y".
  • Open another Git Bash and run a set of commands, for example "cd A/B/C", "vagrant up"
  • Open a regular command window, run the command "cd D/E/F", "grunt watch"

I want the second and third consoles to appear alongside each other, but underneath the first console. So far I am stuck getting commands to run; I have a task that runs the following:

"%ProgramFiles(x86)%\Git\bin\sh.exe" --login -i "-cur_console:n:t:Git Bash" "-cur_console:d:C:\Users\Ole Vik\dev"
"%ProgramFiles(x86)%\Git\bin\sh.exe" --login -i "-cur_console:s1TVn:t:Vagrant"
cmd "-cur_console:s2THn:t:Third"

Reading the ConEmu wiki led me to the new_console and cur_console switches, but I'm having trouble figuring out if I can somehow enter commands in the Task setup, or maybe if I can have it run a .bat script on each console.


回答1:


No colon is needed between switches (n & t for example).

cmd has /k switch to run commands.

I don't know the way to tell bash "run this command and stay in prompt". May be you need to run commands with &. I'm not sure about second line, you need to check it yourself.

"%ProgramFiles(x86)%\Git\bin\sh.exe" --login -i "-cur_console:nt:Git Bash" "-cur_console:d:C:\Users\Ole Vik\dev"
cmd -cur_console:s1TVnt:Vagrant /c vagrant up & "%ProgramFiles(x86)%\Git\bin\sh.exe" --login -i"
cmd -cur_console:s2THnt:Third /k cd /d "D\E\F" & grunt watch


来源:https://stackoverflow.com/questions/21802815/conemu-commands-in-task

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!