Browse Source

Tools: Add tmux support to run_in_terminal_window.sh

Added in an option so that if running SITL in a tmux session it will open a new window in tmux.
More or less an alternate option to screen.
It will detect if its running in a tmux session by checking the $TMUX and $TERM env variables.
I put it before other options because when I am running a tmux session even in a GUI environment
I would prefer a new Tmux window compared to a new terminal.
This will only run if youre already in a tmux session it will not launch a new session.
gps-1.3.1
Braedon O'Meara 4 years ago committed by Peter Barker
parent
commit
de91058b1a
  1. 2
      Tools/autotest/run_in_terminal_window.sh

2
Tools/autotest/run_in_terminal_window.sh

@ -28,6 +28,8 @@ if [ -n "$SITL_RITW_TERMINAL" ]; then @@ -28,6 +28,8 @@ if [ -n "$SITL_RITW_TERMINAL" ]; then
printf "%q " "$@" >>"$FILEPATH"
chmod +x "$FILEPATH"
$SITL_RITW_TERMINAL "$FILEPATH" &
elif [ "$TERM" = "screen" ] && [ -n "$TMUX" ]; then
tmux new-window -dn "$name" "$*"
elif [ -n "$DISPLAY" -a -n "$(which osascript)" ]; then
osascript -e 'tell application "Terminal" to do script "'"$* "'"'
elif [ -n "$DISPLAY" -a -n "$(which xterm)" ]; then

Loading…
Cancel
Save