Browse Source

Tools: change terminal to current dir if using osascript in run_in_terminal_window.sh

- Ensure the spawned terminal has the same pwd as the calling script to allow SITL to resolve relative paths

Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
apm_2208
Rhys Mainwaring 3 years ago committed by Peter Barker
parent
commit
6d7086a8ad
  1. 2
      Tools/autotest/run_in_terminal_window.sh

2
Tools/autotest/run_in_terminal_window.sh

@ -31,7 +31,7 @@ if [ -n "$SITL_RITW_TERMINAL" ]; then @@ -31,7 +31,7 @@ if [ -n "$SITL_RITW_TERMINAL" ]; then
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 "'"$* "'"'
osascript -e 'tell application "Terminal" to do script "'"cd $(pwd) && clear && $* "'"'
elif [ -n "$DISPLAY" -a -n "$(which xterm)" ]; then
if [ $SITL_RITW_MINIMIZE -eq 1 ]; then
ICONIC=-iconic

Loading…
Cancel
Save