Skip to content

Commit 8c4b403

Browse files
committed
fix: delay terminal fitting to fix terminal glitch
1 parent 6273bcf commit 8c4b403

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Extensions/TerminalService/TerminalExtension.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,10 @@ private struct MultiTerminalView: View {
130130
)
131131
.onAppear(perform: {
132132
guard let terminal = App.terminalManager.activeTerminal else { return }
133-
fitTerminalIfReady(terminal)
133+
// Allow WKWebView to get the correct frame size before calling fit
134+
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
135+
fitTerminalIfReady(terminal)
136+
}
134137
})
135138
.onChange(of: App.terminalManager.activeTerminalId) { _ in
136139
guard let terminal = App.terminalManager.activeTerminal else {

0 commit comments

Comments
 (0)