mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
@@ -619,6 +619,11 @@ describe('InputHandler', () => {
|
||||
await inputHandler.parseP('¥¥¥');
|
||||
assert.deepEqual(getLines(bufferService, 2), ['¥¥', '¥']);
|
||||
});
|
||||
it('should strip soft hyphens (U+00AD)', async () => {
|
||||
await inputHandler.parseP('Soft\xadhy\xadphen');
|
||||
assert.strictEqual(bufferService.buffer.translateBufferLineToString(0, true), 'Softhyphen');
|
||||
assert.strictEqual(bufferService.buffer.x, 10);
|
||||
});
|
||||
});
|
||||
|
||||
describe('alt screen', () => {
|
||||
|
||||
@@ -533,6 +533,12 @@ export class InputHandler extends Disposable implements IInputHandler {
|
||||
for (let pos = start; pos < end; ++pos) {
|
||||
code = data[pos];
|
||||
|
||||
// Soft hyphen's (U+00AD) behavior is ambiguous and differs across terminals. We opt to treat
|
||||
// it as a zero-width hint to text layout engines and simply ignore it.
|
||||
if (code === 0xAD) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// get charset replacement character
|
||||
// charset is only defined for ASCII, therefore we only
|
||||
// search for an replacement char if code < 127
|
||||
|
||||
Reference in New Issue
Block a user