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>
This commit is contained in:
Rhys Mainwaring 2022-04-11 16:11:21 +01:00 committed by Peter Barker
parent 51eb398277
commit 6d7086a8ad

View File

@ -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