From de91058b1ac572ab0318995a9bc229655658e7f9 Mon Sep 17 00:00:00 2001 From: Braedon O'Meara Date: Thu, 29 Jul 2021 14:31:12 -0500 Subject: [PATCH] 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. --- Tools/autotest/run_in_terminal_window.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tools/autotest/run_in_terminal_window.sh b/Tools/autotest/run_in_terminal_window.sh index 7eb6ba7c09..6044929477 100755 --- a/Tools/autotest/run_in_terminal_window.sh +++ b/Tools/autotest/run_in_terminal_window.sh @@ -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