Merge pull request #5520 from Tyriar/4961

Ignore soft hyphen
This commit is contained in:
Daniel Imms
2025-12-27 14:57:12 -08:00
committed by GitHub
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -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', () => {
+6
View File
@@ -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