workaround VTEs wide surrogate pair display bug.
This commit is contained in:
parent
b753a8c492
commit
051e90070c
|
@ -2425,6 +2425,14 @@ Element.prototype.parseContent = function(noTags) {
|
|||
// double-width chars will eat the next char after render. create a
|
||||
// blank character after it so it doesn't eat the real next char.
|
||||
content = content.replace(unicode.chars.wide, '$1\x03');
|
||||
// VTE cannot display double-width chars that are also
|
||||
// surrogate pairs: It miscalculates the width of the chars.
|
||||
if (this.screen.program.isVTE) {
|
||||
// In reality we should only drop double-width surrogate pairs,
|
||||
// but we don't have a regex for that yet.
|
||||
// content = content.replace(unicode.chars.surrogateDoubleWidth, '?');
|
||||
content = content.replace(unicode.chars.surrogate, '?');
|
||||
}
|
||||
} else {
|
||||
// no double-width: replace them with question-marks.
|
||||
content = content.replace(unicode.chars.all, '??');
|
||||
|
|
|
@ -93,6 +93,7 @@ lorem = lorem.replace(/e/gi, DOUBLE);
|
|||
//lorem = lorem.replace(/r/gi, JUAN);
|
||||
// NOTE: libvte breaks when trying to display
|
||||
// this surrogate pair double width character:
|
||||
// if (!~process.argv.indexOf('vte') && !screen.program.isVTE) {
|
||||
if (!~process.argv.indexOf('vte')) {
|
||||
lorem = lorem.replace(/a/gi, SURROGATE_DOUBLE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue