fix(desktop): terminal cursor position

This commit is contained in:
Adam 2025-12-05 12:05:30 -06:00
commit 6e6bd1e171
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
2 changed files with 14 additions and 26 deletions

View file

@ -52,19 +52,14 @@ export const Terminal = (props: TerminalProps) => {
term.open(container)
if (local.pty.buffer) {
const originalSize = { cols: term.cols, rows: term.rows }
let resized = false
if (local.pty.rows && local.pty.cols) {
term.resize(local.pty.cols, local.pty.rows)
resized = true
}
term.reset()
term.write(local.pty.buffer)
if (local.pty.scrollY) {
term.scrollToLine(local.pty.scrollY)
}
if (resized) {
term.resize(originalSize.cols, originalSize.rows)
}
}
container.focus()