Skip to content

Commit c2c0519

Browse files
fix: improve terminal resizing logic in event handlers
1 parent 2fe8232 commit c2c0519

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/renderer/tui.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,10 +195,14 @@ function setupEventHandlers(
195195
state.ptyInfo = info;
196196
if (screen && !state.screenDestroyed) {
197197
screen.terminal = info.term || "xterm-256color";
198-
screen.program.cols = info.cols;
199-
screen.program.rows = info.rows;
200-
screen.cols = info.cols;
201-
screen.rows = info.rows;
198+
if (stream) {
199+
stream.columns = info.cols;
200+
stream.rows = info.rows;
201+
}
202+
const program = screen.program as any;
203+
if (program && typeof program.resize === "function") {
204+
program.resize(info.cols, info.rows);
205+
}
202206
screen.alloc();
203207
triggerResize();
204208
}

0 commit comments

Comments
 (0)