Skip to content

Commit

Permalink
Merge pull request #4851 from davidfiala/fix-xterm-node21
Browse files Browse the repository at this point in the history
proper isNode detection for node v21.0.0
  • Loading branch information
Tyriar committed Oct 19, 2023
2 parents 1c880f5 + 0d0166b commit 9fff1e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/common/Platform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ interface INavigator {
// We're declaring a navigator global here as we expect it in all runtimes (node and browser), but
// we want this module to live in common.
declare const navigator: INavigator;
declare const process: unknown;

export const isNode = (typeof navigator === 'undefined') ? true : false;
export const isNode = (typeof process !== 'undefined') ? true : false;
const userAgent = (isNode) ? 'node' : navigator.userAgent;
const platform = (isNode) ? 'node' : navigator.platform;

Expand Down

0 comments on commit 9fff1e6

Please sign in to comment.