Skip to content

Commit

Permalink
Don't run the Bubble Tea program if there are ssh commands
Browse files Browse the repository at this point in the history
  • Loading branch information
Toby Padilla committed Jul 30, 2021
1 parent 541e994 commit af11646
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tui/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@ func (e errMsg) Error() string {
}

func SessionHandler(s ssh.Session) tea.Model {
pty, changes, active := s.Pty()
if !active {
return nil
if len(s.Command()) == 0 {
pty, changes, active := s.Pty()
if !active {
return nil
}
return NewModel(pty.Window.Width, pty.Window.Height, changes)
}
return NewModel(pty.Window.Width, pty.Window.Height, changes)
return nil
}

type Model struct {
Expand Down

0 comments on commit af11646

Please sign in to comment.