Skip to content

Commit

Permalink
terminal: use start with appropriate size
Browse files Browse the repository at this point in the history
Use the StartWithSize method to start the terminal with the appropriate
size. This prevents multiple WINCH signals from being sent to the pty at
startup

Signed-off-by: Tim Culverhouse <[email protected]>
Acked-by: Robin Jarry <[email protected]>
  • Loading branch information
rockorager authored and rjarry committed Feb 12, 2024
1 parent 6314e2d commit a977d12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/terminal.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ func (term *Terminal) Draw(ctx *ui.Context) {
term.ctx = ctx
if !term.running && term.cmd != nil {
term.vterm.Attach(term.HandleEvent)
if err := term.vterm.Start(term.cmd); err != nil {
w, h := ctx.Window().Size()
if err := term.vterm.StartWithSize(term.cmd, w, h); err != nil {
log.Errorf("error running terminal: %v", err)
term.closeErr(err)
return
Expand Down

0 comments on commit a977d12

Please sign in to comment.