Optimize a specific workflow involving running multiple terminal commands in parallel

Hi,

I'm looking for a way to optimize / make it the following workflow faster (for me, as a human, as in: less manual steps involved).

The setup:

  • main editor window
  • a separate terminal window (also: on a separate screen)
  • with 4 tabs open

In these 4 tabs I run 4 separate commands, in parallel, when I reach a certain milestone during development. As in: I want to manually trigger this.

  • each shell command I run in a separate tab is independent of the others (i.e. they check / perform things unrelated to the others)
  • the output of each tab is only relevant if the exit code is non-zero
  • but when a non-zero exit code happens, I need to see the output of that failed command, and only of that failed command.
  • I prefix all the commands with `clear ; <command>` so that old terminal screen is cleaned up, so it's easier, in case of errors, to search / scroll up to relevant parts and not have outdated history. As in: the terminals history is rarely relevant.

Ideally I've a key press combination I could trigger all of this, as I currently manually go into each tab, press cursor up for the last command, and press enter. And then I need to wait / check the tabs to wait & see until the commands return successfully or not.

I looked into “External Tools” and also used them a bit in the past, but not sure how this all could be doable. For example, in one shell I run in fact two commands, but they need to run in sequence, so it would be: `command1 arg1 && command2 arg2`. That I already couldn't get to work. But even a simple `command arg` didn't work (do I need to use full paths? Tried to, didn't work).

Any help would be appreciated, thanks!

 

 

0

Please sign in to leave a comment.