Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Conemu startup with a task opening multiple tabs

Tags:

conemu

Is there a way with conEmu to by default open a number of different tabs? I saw this page explaining how to do this with splits, and I realize I can do Ctrl + T, 1, Enter, but I was hoping there was a way to do this automatically!

"%GIT_HOME%\usr\bin\sh.exe" --login -i -cur_console:t:"repo1":C:"%GIT_HOME%\git-bash.exe":d:"%USERPROFILE%\code\repo1"

"%GIT_HOME%\usr\bin\sh.exe" --login -i -new_console:t:"repo2":C:"%GIT_HOME%\git-bash.exe":d:"%USERPROFILE%\code\repo2"

"%GIT_HOME%\usr\bin\sh.exe" --login -i -new_console:t:"repo3":C:"%GIT_HOME%\git-bash.exe":d:"%USERPROFILE%\code\repo3"
like image 249
James Affleck Avatar asked Apr 21 '17 17:04

James Affleck


1 Answers

Yes, it is possible but not via the settings Dialog of Conemu. You need a small config file

  1. Create Config File

    1. Go to Conemu installation directory (like C:\Program Files\ConEmu)
    2. Create file startup.txt
    3. List the consoles you want to open at startup. For example

    >C:\Program Files\staab\Git\bin\bash.exe

    >C:\WINDOWS\system32\cmd.exe

    will open Git Bash and cmd at startup (in that order). If you want to set the startup directories for each console you can do this too:

    >C:\Program Files\staab\Git\bin\bash.exe -new_console:d:C:\example\path

    >C:\WINDOWS\system32\cmd.exe -new_console:d:C:\other\path

  2. Start Conemu with that config file

    1. Create a new desktop shortcut for the ConEmu64.exe (or ConEmu.exe if you use the 32-Bit version)
    2. Right click > Properties on that shortcut.
    3. Add /cmd @startup.txt to the target

    enter image description here

  3. Now you can link that shortcut to your task bar or put it in the autostart folder of your computer to start Conemu with those consoles right after login.

Update 1: Name for Tab

I just found out that you can also set the name of all the tabs on startup :-)

>C:\Program Files\staab\Git\bin\bash.exe -new_console:d:C:\example\path -cur_console:t:NAME_OF_TAB

Update 2: Admin Rights

And this is how you give admin rights to the tabs of your choice:

>C:\Program Files\staab\Git\bin\bash.exe -new_console:d:C:\example\path -new_console:a

Don't use this more than necessary, because you have to confirm admin rights for each window individually.

like image 170
Ruik Avatar answered Oct 05 '22 00:10

Ruik