mirror of
https://github.com/NuSkooler/enigma-bbs.git
synced 2025-07-21 10:15:55 +02:00
Add isNixTerm(), use includes vs indexOf on array search
This commit is contained in:
parent
1784afffa7
commit
47551b1803
1 changed files with 12 additions and 1 deletions
|
@ -110,6 +110,17 @@ ClientTerminal.prototype.disconnect = function() {
|
||||||
this.output = null;
|
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() {
|
ClientTerminal.prototype.isANSI = function() {
|
||||||
//
|
//
|
||||||
// ANSI terminals should be encoded to CP437
|
// ANSI terminals should be encoded to CP437
|
||||||
|
@ -142,7 +153,7 @@ ClientTerminal.prototype.isANSI = function() {
|
||||||
// linux:
|
// linux:
|
||||||
// * JuiceSSH (note: TERM=linux also)
|
// * 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)
|
// :TODO: probably need to update these to convert IAC (0xff) -> IACIAC (escape it)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue