I need to setup startup tasks in order to have 3 git bash tabs opened on startup, each in different location.
To open various tabs on various places I used
cmd -new_console:s /k "%ConEmuBaseDir%\CmdInit.cmd" & d: & cd \Projects\Project1
cmd -new_console:s /k "%ConEmuBaseDir%\CmdInit.cmd" & d: & cd \Projects\Project2
cmd -new_console:s /k "%ConEmuBaseDir%\CmdInit.cmd" & d: & cd \Projects\Project3
There is already a predefined task for Git bash
{Bash::Git bash}
"%ConEmuDrive%\Program Files\Git\git-cmd.exe" --command=usr/bin/bash.exe -l -i
So i tried following solutions
cmd -new_console:s /k "%ConEmuBaseDir%\CmdInit.cmd" & d: & cd \Projects\Project1 {Bash::Git bash}
and
{Bash::Git bash} -new_console:s /k "%ConEmuBaseDir%\CmdInit.cmd" & d: & cd \Projects\Project1
but none of them work.
How to solve it?
Feels sad when an inexperienced user doesn't get a proper help from the author... Oh well. Simple solution is:
Open Settings.
Go to Startup > Tasks.
Click on the plus to add new predefined task.
Name it Git bash::Project1.
Fill in following command
Repeat this step for all desired project. Add one new predefined task. Call it My. Fill in following
Click on Startup.
Select Specified named task and select {My}.
Restart.
Voila.
Awful...
First of all, ConEmu docs tells that you may use simple
-new_console:d:"d:\Projects\Project"
to set startup directory.You can't "execute" the
{Bash::Git bash}
fromcmd.exe
, what you try to do using/k
switch. The{Bash::Git bash}
is ConEmu Task and only ConEmu knows how to "run" it.You last try
{Bash::Git bash} /k "%ConEmuBaseDir%\CmdInit.cmd"
is absolutely wrong. The Bash does not ever know how to execute*.cmd
files. Andbash.exe
does not support the/k
switch.At last, your bash version may set specific directory via bash profile. Possible workarounds are described in docs.
BTW, instead of
d: & cd \Projects\Project3
it's more handy and descriptive to callcd /d d:\Projects\Project3
.