diff --git a/packages/tools/src/getDefaultUserTerminal.ts b/packages/tools/src/getDefaultUserTerminal.ts index a5bf91914..fb07ea1b7 100644 --- a/packages/tools/src/getDefaultUserTerminal.ts +++ b/packages/tools/src/getDefaultUserTerminal.ts @@ -1,4 +1,17 @@ -const getDefaultUserTerminal = (): string | undefined => - process.env.REACT_TERMINAL || process.env.TERM_PROGRAM; +import os from 'os'; + +const getDefaultUserTerminal = (): string | undefined => { + const {REACT_TERMINAL, TERM_PROGRAM, TERM} = process.env; + + if (REACT_TERMINAL) { + return REACT_TERMINAL; + } + + if (os.platform() === 'darwin') { + return TERM_PROGRAM; + } + + return TERM; +}; export default getDefaultUserTerminal;