throughline 0.3.16 → 0.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/token-monitor.mjs +7 -2
package/package.json
CHANGED
package/src/token-monitor.mjs
CHANGED
|
@@ -587,7 +587,10 @@ export function main() {
|
|
|
587
587
|
setMeasuredColumns(cols);
|
|
588
588
|
const curr = resolveColumns();
|
|
589
589
|
if (prev !== curr) {
|
|
590
|
-
//
|
|
590
|
+
// 幅が変わると前フレームは別幅で wrap している可能性があり、CUU ベースの
|
|
591
|
+
// 部分再描画では消し残る。全画面クリアで確実にリセットしてから描き直す。
|
|
592
|
+
// greeting も消えるが、resize の瞬間だけの一時的コスト。
|
|
593
|
+
process.stdout.write(ANSI.clearScreen);
|
|
591
594
|
lastRenderedLines = 0;
|
|
592
595
|
resetRenderKeyCache();
|
|
593
596
|
safeRenderFrame(args);
|
|
@@ -612,6 +615,7 @@ export function main() {
|
|
|
612
615
|
const currCols = process.stdout.columns ?? 0;
|
|
613
616
|
if (shouldForceFullRedraw(lastColumns, currCols)) {
|
|
614
617
|
lastColumns = currCols;
|
|
618
|
+
process.stdout.write(ANSI.clearScreen);
|
|
615
619
|
lastRenderedLines = 0;
|
|
616
620
|
resetRenderKeyCache();
|
|
617
621
|
safeRenderFrame(args);
|
|
@@ -631,8 +635,9 @@ export function main() {
|
|
|
631
635
|
if (resizeTimer) clearTimeout(resizeTimer);
|
|
632
636
|
resizeTimer = setTimeout(() => {
|
|
633
637
|
resizeTimer = null;
|
|
634
|
-
//
|
|
638
|
+
// 既存描画が新しい幅では崩れている可能性があるため全画面クリアで描き直す
|
|
635
639
|
lastColumns = process.stdout.columns ?? 0;
|
|
640
|
+
process.stdout.write(ANSI.clearScreen);
|
|
636
641
|
lastRenderedLines = 0;
|
|
637
642
|
resetRenderKeyCache();
|
|
638
643
|
safeRenderFrame(args);
|