ConEmu Layout with multiple columns and rows as startup task - conemu

We have a rather complex gulp build process that involves several modules where each has one or two watches. I would like to monitor this in one dashboard like this:
Each Column is one module, each row inside a column a subsequent build step.
Once the gulp script in column 1 is done, the watch in module 2a (top) will trigger, then 2b (bottom), 3a, 3b, 4a, 4b... you get the idea.
So far I have figured out how to create the columns
* -cur_console:t:'1' cmd.exe
* -new_console:s75H -cur_console:t:"2a" cmd.exe
* -new_console:s66H -cur_console:t:"3a" cmd.exe
* -new_console:s50H -cur_console:t:"4a" cmd.exe
But cmdemu always takes the previously created console as "parent" to create the new one, so this will obviously fail...
* -cur_console:t:'1' cmd.exe
* -new_console:s75H -cur_console:t:"2a" cmd.exe
* -new_console:s50V -cur_console:t:"2b" cmd.exe
* -new_console:s66H -cur_console:t:"3a" cmd.exe
* -new_console:s50V -cur_console:t:"3b" cmd.exe
* -new_console:s50H -cur_console:t:"4a" cmd.exe
* -new_console:s50V -cur_console:t:"4b" cmd.exe
Giving me something like this...
How can I create this sort of layout?

Actually, docs describes how you may split specific pane: just use T subswitch to define splitting pane.
-cur_console:t:'1' cmd.exe
-new_console:s75H -cur_console:t:"2a" cmd.exe
-new_console:s66H -cur_console:t:"3a" cmd.exe
-new_console:s50H -cur_console:t:"4a" cmd.exe
-new_console:s2T50V -cur_console:t:"2b" cmd.exe
-new_console:s3T50V -cur_console:t:"3b" cmd.exe
-new_console:s4T50V -cur_console:t:"4b" cmd.exe
Or, if you want to have sorted tabs
-cur_console:t:'1' cmd.exe
-new_console:s75H -cur_console:t:"2a" cmd.exe
-new_console:s2T50V -cur_console:t:"2b" cmd.exe
-new_console:s2T66H -cur_console:t:"3a" cmd.exe
-new_console:s3T66H -cur_console:t:"3b" cmd.exe
-new_console:s4T50H -cur_console:t:"4a" cmd.exe
-new_console:s5T50H -cur_console:t:"4b" cmd.exe

Related

conemu - how to 'group input' in a task?

I have created a task in conemu which launches 3 consoles and ssh to 3 different servers. I would like to also 'group inputs' directly when launching this new task.
Right now, I need to press Apps+G once the 3 consoles are up in order to be able to run the same command in all three consoles.
Is there a way to get Apps+G to be called when launching the task without I having to do it ?
Supposing you start three cmd.exe consoles. First one would be active. Last line executes GuiMacro and immediately terminates.
>cmd.exe /k "%ConEmuBaseDir%\CmdInit.cmd"
cmd.exe /k "%ConEmuBaseDir%\CmdInit.cmd"
cmd.exe /k "%ConEmuBaseDir%\CmdInit.cmd"
cmd /c -cur_console:n ConEmuC -GuiMacro GroupInput 4

Start a batch file and close Cmd once it is finished

I have my application spread over multiple directories, each containing a part (e.g. web frontend, mobile application, administration, middleware, backend, ...).
In each of the directories I have one part, and a file compile.cmd which compiles that part and looks roughly like this:
#ECHO OFF
compiler prepare thisPart
compiler compile thisPart
copy resultingFile1 ../bundleDirectory
...
copy resultingFileN ../bundleDirectory
pause
The "pause" is so I can check the compiler output, whether compile failed and which error messages occurred, and then close the window with a single keystroke (mostly, space key).
I now want to have a batch file that calls all these batch files for different application parts in parallel, so I guess I have to open a new shell window for each.
So I wrote CompileAllParts.cmd like this:
cd part1
start "Compile part 1" compile.cmd
cd ../part2
start "Compile part 2" compile.cmd
cd ../part3
start "Compile part 3" compile.cmd
Positive is that I can influence the window title, but the drawback is that new Cmds are spawned which do not automatically close.
This is also part of the documentation of start:
If command is an internal cmd command or a batch file then the command processor is run with the /K switch to cmd.exe. This means that the window will remain after the command has been run.
Is there a hidden parameter to explicitly disable this behaviour?
combine start with cmd. First to set title and working folder, second to use /C and execute the command:
start "Compile part 1" /d "part1" cmd /c "d:\proper folder\compile.cmd"

How to execute multiple commands from a batch file, in windows command prompt, while keeping the command prompt context open?

I want to create a batch file that would execute two commands one after the other, and then keep the CMD window open. The following is what I tried, after some searching on the internet, but only the first command is getting executed.
What am I missing?
cmd /k C:\Users\Hp\yolo\test1\.env1\Scripts\activate && cd C:\Users\Hp\yolo\test2
I also tried with just one '&' instead of two, but that doesn't work either. Only the first command gets executed in both cases.
doskey /macrofile=%~dp0adb_macros.txt
color 9F
cmd /K
For those who came here for an example of an actual answer

Setup cmd.exe parameter when starting ConEmu

I have some configuration setting in config.bat, I can manually execute it using cmd.exe /k "%HOMEDRIVE%%HOMEPATH%\config.bat"
How can I setup ConEmu to execute cmd.exe with parameters ?
I tried to put the cmd.exe + parameters in the Task parameters.. and Commands (application, argument).., but neither of them is working.
Please help, thanks.
You missed it just by a inch :-)
Simply put the cmd /k <path>\<to>\<your>\config.bat in the Commands text area.
(sorry I can not post images yet)

How to run multiple commands in cmd using a script

I have three different commands that I want to execute my running one script,
I created a file called as myscript.bat
I want the following two commands to run in sequence when I run the script:
cd C:\Users\johnDoe\Idea\View\Proxy
node proxy.js
PS:And after that I want the cmd to be left open, not close automatically
Leave the bat file as it is, but run it with cmd /k myscript.bat. Also, if there's a chance of the command window opening by default on another drive, you might want to add the line C: to the beginning of the script to change volumes. cd changes folders within a given volume, but it doesn't actually change volumes.
Alternatively, if you just want the window to stay open so you can read the output, but you don't actually want to run any additional commands in it after your commands finish, you can just add the line pause at the end of the script.
#reirab's answer contains the crucial pointer: use cmd /k to create a console window that stays open.
If you don't want to use cmd /k explicitly - say, because you want to open the batch file from Explorer, you have 2 options:
[Suboptimal] Add a cmd /k statement as the last statement to your batch file.
[Better] Write a wrapper batch file that invokes the target batch file with cmd /k.
For instance, if your batch file is startProxy.bat, create another batch file in the same folder, name it startProxyWrapper.bat, and assign the following content:
#cmd /k "%~dp0startProxy.bat"
When you then open startProxyWrapper.bat from Explorer, a persistent console window (one that stays open) will open and execute startProxy.bat.

Resources