Fix search when the search line contains a null character

Fixes #3834
This commit is contained in:
Daniel Imms
2022-05-26 15:09:01 -07:00
parent cd975d22cc
commit 0c0a34d888
2 changed files with 17 additions and 1 deletions
+2 -1
View File
@@ -610,7 +610,8 @@ export class SearchAddon implements ITerminalAddon {
break;
}
if (cell.getWidth()) {
offset += cell.getChars().length;
// Treat null characters as whitespace to align with the translateToString API
offset += cell.getCode() === 0 ? 1 : cell.getChars().length;
}
}
lineIndex++;