From 6d7086a8ad2ec868289595e4bd826cbfd4004ae1 Mon Sep 17 00:00:00 2001 From: Rhys Mainwaring Date: Mon, 11 Apr 2022 16:11:21 +0100 Subject: [PATCH] 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 --- Tools/autotest/run_in_terminal_window.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/autotest/run_in_terminal_window.sh b/Tools/autotest/run_in_terminal_window.sh index 6044929477..86bd86a2d1 100755 --- a/Tools/autotest/run_in_terminal_window.sh +++ b/Tools/autotest/run_in_terminal_window.sh @@ -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