I'm trying to open a new tab and run a command in it. Instead, this opens a new tab which opens a new window and then runs the command... What am I doing wrong?
exec(`osascript -e 'tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down' -e 'tell application \"Terminal\" to do script \"export KUBECONFIG=${basePath}/${answer.clustername}/${configfile}\"'`);
I had to add in window 1
at the very end for it to work in the new tab (instead of opening a new window).