mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
remove URXVT and UTF8 encoding from codebase
This commit is contained in:
@@ -34,7 +34,7 @@ describe('CoreMouseService', () => {
|
||||
});
|
||||
it('default encodings - DEFAULT, UTF8, SGR, URXVT', () => {
|
||||
const cms = new CoreMouseService(bufferService, coreService);
|
||||
assert.deepEqual(Object.keys((cms as any)._encodings), ['DEFAULT', 'UTF8', 'SGR', 'URXVT']);
|
||||
assert.deepEqual(Object.keys((cms as any)._encodings), ['DEFAULT', 'SGR']);
|
||||
});
|
||||
it('protocol/encoding setter, reset', () => {
|
||||
const cms = new CoreMouseService(bufferService, coreService);
|
||||
@@ -151,14 +151,6 @@ describe('CoreMouseService', () => {
|
||||
}
|
||||
}
|
||||
});
|
||||
it('UTF8 encoding', () => {
|
||||
cms.activeProtocol = 'ANY';
|
||||
cms.activeEncoding = 'UTF8';
|
||||
for (let i = 0; i < bufferService.cols; ++i) {
|
||||
assert.equal(cms.triggerMouseEvent({ col: i, row: 0, button: CoreMouseButton.LEFT, action: CoreMouseAction.DOWN }), true);
|
||||
assert.deepEqual(toBytes(reports.pop()), [0x1b, 0x5b, 0x4d, 0x20, i + 33, 0x21]);
|
||||
}
|
||||
});
|
||||
it('SGR encoding', () => {
|
||||
cms.activeProtocol = 'ANY';
|
||||
cms.activeEncoding = 'SGR';
|
||||
@@ -167,14 +159,6 @@ describe('CoreMouseService', () => {
|
||||
assert.deepEqual(reports.pop(), `\x1b[<0;${i + 1};1M`);
|
||||
}
|
||||
});
|
||||
it('URXVT', () => {
|
||||
cms.activeProtocol = 'ANY';
|
||||
cms.activeEncoding = 'URXVT';
|
||||
for (let i = 0; i < bufferService.cols; ++i) {
|
||||
assert.equal(cms.triggerMouseEvent({ col: i, row: 0, button: CoreMouseButton.LEFT, action: CoreMouseAction.DOWN }), true);
|
||||
assert.deepEqual(reports.pop(), `\x1b[32;${i + 1};1M`);
|
||||
}
|
||||
});
|
||||
});
|
||||
it('eventCodes with modifiers (DEFAULT encoding)', () => {
|
||||
// TODO: implement AUX button tests
|
||||
|
||||
@@ -132,17 +132,6 @@ const DEFAULT_ENCODINGS: {[key: string]: CoreMouseEncoding} = {
|
||||
// FIXED: params = params.map(v => (v > 255) ? 0 : value);
|
||||
return `\x1b[M${S(params[0])}${S(params[1])}${S(params[2])}`;
|
||||
},
|
||||
/**
|
||||
* UTF8 - CSI M Pb Px Py
|
||||
* Same as DEFAULT, but with optional 2-byte UTF8
|
||||
* encoding for values > 223 (can encode up to 2015).
|
||||
*/
|
||||
UTF8: (e: ICoreMouseEvent) => {
|
||||
let params = [eventCode(e, false) + 32, e.col + 32, e.row + 32];
|
||||
// limit to 2-byte UTF8
|
||||
params = params.map(v => (v > 2047) ? 0 : v);
|
||||
return `\x1b[M${S(params[0])}${S(params[1])}${S(params[2])}`;
|
||||
},
|
||||
/**
|
||||
* SGR - CSI < Pb ; Px ; Py M|m
|
||||
* No encoding limitation.
|
||||
@@ -151,14 +140,6 @@ const DEFAULT_ENCODINGS: {[key: string]: CoreMouseEncoding} = {
|
||||
SGR: (e: ICoreMouseEvent) => {
|
||||
const final = (e.action === CoreMouseAction.UP && e.button !== CoreMouseButton.WHEEL) ? 'm' : 'M';
|
||||
return `\x1b[<${eventCode(e, true)};${e.col};${e.row}${final}`;
|
||||
},
|
||||
/**
|
||||
* URXVT - CSI Pb ; Px ; Py M
|
||||
* Same button encoding as default, decimal encoding for coords.
|
||||
* Ambiguity with other sequences, should not be used.
|
||||
*/
|
||||
URXVT: (e: ICoreMouseEvent) => {
|
||||
return `\x1b[${eventCode(e, false) + 32};${e.col};${e.row}M`;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user