Skip to content

Commit

Permalink
fix: Use correct terminal on linux systems (#1099)
Browse files Browse the repository at this point in the history
  • Loading branch information
Esemesek authored Apr 5, 2020
1 parent 2d63746 commit e87b6b5
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions packages/tools/src/getDefaultUserTerminal.ts
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit e87b6b5

Please sign in to comment.