Set pid to do shell script 'ps -c -t ' & dev & ' | awk '$4= \' ' & runtimeName & ' \' ' ' find the 'process' that runs under the given tty and remember its process id Set targetTab to selected tab of targetWindow Repeat while ( count of every tab in targetWindow) = tabCount Tell application 'System Events ' to keystroke 't ' using command down Set tabCount to count of every tab in targetWindow Delay required if/when you have to switch to a fullscreen Terminal.app instance since the new tab command will not fire in Terminal.app Create a new tab if the current window is busy Set targetTab to selected tab of targetWindow - Default to the current tab Set targetWindow to front window - Default to the front window Set env_vars to env_vars & ' ' & quoted form of ( item i of argv) Set program to quoted form of ( item i of argv)
Set runtime to quoted form of ( item i of argv) Set working_dir to quoted form of ( item i of argv) This file resides at /Applications/Visual Studio Code.app/Contents/Resources/app/client/vs/workbench/contrib/debug/bin/TerminalHelper.scpt