Don't run the Bubble Tea program if there are ssh commands

Toby Padilla created

Change summary

tui/model.go | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

Detailed changes

tui/model.go 🔗

@@ -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 {