fix(terminal): improve terminal dimensions and fit timing
All checks were successful
Beta Release / beta (push) Successful in 47s
All checks were successful
Beta Release / beta (push) Successful in 47s
Use min-height:0 on xterm-wrapper (flex child) instead of height:100% to properly fill available space in flex layout. Add delayed fit() calls after initialization to let the layout stabilize before calculating terminal cell dimensions. 💘 Generated with Crush Assisted-by: GLM-5.1 via Crush <crush@charm.land>
This commit is contained in:
@@ -439,6 +439,12 @@ export default function Shell({ api }) {
|
||||
const entry = tabsRef.current[tab.id]
|
||||
if (entry) entry.fitAddon.fit()
|
||||
}
|
||||
setTimeout(() => {
|
||||
for (const tab of tabsRef.current._tabList || []) {
|
||||
const entry = tabsRef.current[tab.id]
|
||||
if (entry) entry.fitAddon.fit()
|
||||
}
|
||||
}, 150)
|
||||
})
|
||||
}, [initTerminal])
|
||||
|
||||
@@ -472,11 +478,11 @@ export default function Shell({ api }) {
|
||||
requestAnimationFrame(() => {
|
||||
if (cancelled) return
|
||||
const entry = tabsRef.current[tab.id]
|
||||
if (entry) entry.fitAddon.fit()
|
||||
if (entry) {
|
||||
entry.fitAddon.fit()
|
||||
setTimeout(() => { if (!cancelled) entry.fitAddon.fit() }, 100)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
for (const tab of tabs) {
|
||||
if (!tabsRef.current[tab.id]) {
|
||||
tryInitTab(tab, 0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user