I want open a new terminal window on macOS
const cp = require('child_process');
function terminal() {
switch (process.platform) {
case "win32":
cp.spawn('cmd', ['/C', 'start cmd.exe']); return true;
case "darwin":
cp.spawn(`open ${process.env.SHELL}`, [], {cwd: '/'}); return true;
// console.log(process.env); return false;
default:
return false;
}
}
exports.run_terminal = terminal;
This code is working good on windows platform, but not in MacOS