1

I'm using something similar to a shell script that launches multiple pieces of software, each piece needing its own terminal for output (specifically, I'm launching multiple ROS nodes from a roslaunch command). Currently, it runs something like as follows:

xterm -e ./startProgram1
xterm -e ./startProgram2
xterm -e ./startProgram3

Which will open each of the programs in a new terminal. I would like to maintain this functionality, but instead of having a new separate terminal for each, I would like a new section in a manager such as Terminator (i.e. instead of opening a new terminal, it creates a new section in the existing Terminator window and puts the output in that new section). Would this be possible? Because of the specifics of ROS (see above link), I can only specify a "terminal prefix", i.e. the "xterm -e" part of the command that comes before the command for starting the program.

1 Answer 1

1

You could use tmux. Here I describe how to start tmux with four panels.

In your case, you could use and adapt this script.

#!/bin/bash

session="mysession"

if tmux has-session -t "$session"; then
  "Session $SESSION already exists."
  exit 0
fi

# start ./startProgram1 here
tmux new-session -d -s "$session" mc

# start all other applications
# use -v for vertical split and -h for horizontal

tmux select-window -t "$session":0

# start ./startProgram2 here
tmux split-window -v nano

tmux select-window -t "$session":0

# start ./startProgram3 here
tmux split-window -h vi

tmux attach -t "$session"

The current behavior is

enter image description here

1
  • tmux is awesome, I got it working as I needed it. Thanks for the tip!
    – Jordan
    May 12, 2015 at 3:00

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .