index.js:148
let cmd = `osascript -e 'tell application "Terminal" to activate' -e 'tell application "Terminal" to do script "clear && cd ${filePath.dir} && time ./${filePath.name} && ${closeCmd} && while [ true ];do read -t 3 -n 1;if [ $? = 0 ];then exit;else continue;fi;done"'`
child_process.exec(cmd, options);
will produce a cleaner terminal and wait for enter at the end of the program to close the session and close the window instantly if you change this option in terminal preferences

Preview

index.js:148
will produce a cleaner terminal and wait for enter at the end of the program to close the session and close the window instantly if you change this option in terminal preferences
Preview