fix(addon-fit): remove redundant same-dimension guard in fit()

Terminal.resize() already no-ops internally when dimensions haven't
changed. The addon's guard prevented resize() from being called at all,
forcing callers using ResizeObserver-based layouts to use perturbation
workarounds (resize to rows-1, then fit) that race with the observer.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Tyler Vorpahl
2026-03-15 19:35:56 -04:00
co-authored by Claude Opus 4.6
parent 1432e20082
commit 9f6c7d7ced
2 changed files with 12 additions and 4 deletions
+1 -4
View File
@@ -48,10 +48,7 @@ export class FitAddon implements ITerminalAddon, IFitApi {
return;
}
// Force a full render
if (this._terminal.rows !== dims.rows || this._terminal.cols !== dims.cols) {
this._terminal.resize(dims.cols, dims.rows);
}
this._terminal.resize(dims.cols, dims.rows);
}
public proposeDimensions(): ITerminalDimensions | undefined {