fix(desktop): terminal cursor position
This commit is contained in:
parent
81ee2d2332
commit
6e6bd1e171
2 changed files with 14 additions and 26 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue