fix(input): count code points when clearing prompts

This commit is contained in:
DodgyBadger
2026-09-20 07:18:49 +00:00
parent 0761de3dae
commit a220c28a14
4 changed files with 20 additions and 8 deletions
+3 -2
View File
@@ -4069,8 +4069,9 @@ Object.assign(CodemanApp.prototype, {
this._localEchoOverlay.suppressBufferDetection();
this._flushedOffsets?.delete(this.activeSessionId);
this._flushedTexts?.delete(this.activeSessionId);
if (flushed.count > 0) {
this.sendInput('\x7f'.repeat(flushed.count)).catch(() => {});
const flushedLength = Array.from(flushed.text || '').length;
if (flushedLength > 0) {
this.sendInput('\x7f'.repeat(flushedLength)).catch(() => {});
}
} else {
// In non-local-echo mode the TUI already owns the editable buffer. Ctrl+U