From 47551b18034c872f349b281756c9715c71a37e75 Mon Sep 17 00:00:00 2001 From: Bryan Ashby Date: Sun, 24 Sep 2017 11:15:26 -0600 Subject: [PATCH] Add isNixTerm(), use includes vs indexOf on array search --- core/client_term.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/core/client_term.js b/core/client_term.js index 9992f9f3..b313841e 100644 --- a/core/client_term.js +++ b/core/client_term.js @@ -110,6 +110,17 @@ ClientTerminal.prototype.disconnect = function() { this.output = null; }; +ClientTerminal.prototype.isNixTerm = function() { + // + // Standard *nix type terminals + // + if(this.termType.startsWith('xterm')) { + return true; + } + + return [ 'xterm', 'linux', 'screen', 'dumb', 'rxvt', 'konsole', 'gnome', 'x11 terminal emulator' ].includes(this.termType); +}; + ClientTerminal.prototype.isANSI = function() { // // ANSI terminals should be encoded to CP437 @@ -142,7 +153,7 @@ ClientTerminal.prototype.isANSI = function() { // linux: // * JuiceSSH (note: TERM=linux also) // - return [ 'ansi', 'pcansi', 'pc-ansi', 'ansi-bbs', 'qansi', 'scoansi', 'syncterm' ].indexOf(this.termType) > -1; + return [ 'ansi', 'pcansi', 'pc-ansi', 'ansi-bbs', 'qansi', 'scoansi', 'syncterm' ].includes(this.termType); }; // :TODO: probably need to update these to convert IAC (0xff) -> IACIAC (escape it)