Search code examples
conemu

How to arrange on a grid conemu new consoles


I've read the docs about conemu regarding the switch -new_console but I find the syntax pretty confusing and I'm not sure how to create the exact grid layouts I want to.

Here's what I've got so far, consider this script run.cmd:

cmd /c server_0.cmd -new_console:sV
cmd /c microservice_0.cmd -new_console:sV
cmd /c microservice_1.cmd -new_console:sV
cmd /c microservice_2.cmd -new_console:sV
cmd /c docker_1.cmd -new_console:sV
cmd /c docker_2.cmd -new_console:sV

When i run run.cmd with conemu the grid layout will look like this (6x1):

--------------
invoker
--------------
server_0
--------------
microservice_0
--------------
microservice_1
--------------
microservice_2
--------------
docker_1
--------------
docker_2
--------------

How can i tweak run.cmd in a way that will create a new conemu terminal with below arrangement?

--------------------------------------------
                 server_0
--------------------------------------------
microservice_0|microservice_1|microservice_2
--------------------------------------------
docker_1            |          docker_2
--------------------------------------------

Is it possible? If it wasn't possible the above, maybe something like a 3x2 grid would be also nice:

--------------------------------
server_0       |  microservice_0
--------------------------------
microservice_1 |  microservice_2
--------------------------------
docker_1       |  docker_2
--------------------------------

In any case, reason why I'm asking this is because I'd like to have this arrangement fullscreen on 2nd screen so I'll be able to see the logs at once. Also, the reason why I want all of them in a new conemu terminal is because that way I can close all of them at once and spawn them again if i need to.

Last but not least, if there is a better way (that uses conemu best practices), please share... i was thinking maybe this should become a task instead having living in a script (where i need to cd to that directory, spawn it manually, etc...)

Thanks in advance!


Solution

  • The best way I think is to create a new task in the settings and importing there the current tabs.
    And yes, the desired geometry is possible. You can create it easily, but it's not so intuitive in the beginning.
    To do it you've to right-click on a tab and then you can see this menu:

    enter image description here

    It's most easy to create first the rows and divide the windows in each row then, else you might be stuck if you want to add a row above is not possible with the limited options in the menu.
    This way you can create your desired geometry like you can see:

    enter image description here

    When you're satisfied with your windows you can open the settings and save your current configuration:

    enter image description here

    enter image description here

    clicking the marked button imports then all your tabs with settings:

    enter image description here

    Saving the settings, is storing this Task in the file ConEmu.xml and is always available as option to select:

    enter image description here

    If you want to create a different script to configure conemenu you can read the settings in the xml-file from the created task including all the configuration:

    enter image description here

    The advantage in doing it with this visual help is that you can configure each window directly with the correct terminal (and perhaps even further settings), and that's saved together with the geometrical settings.

    If you want it reduced really to the commands like in your question then I'd propose this page