Skip to content

Commit

Permalink
fix: ignore if the tea app didnt report an exit status (#123)
Browse files Browse the repository at this point in the history
* fix: ignore if the tea app didnt report an exit status

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>

* fix: log issues

Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
  • Loading branch information
caarlos0 authored Nov 10, 2022
1 parent 45c6add commit fd88793
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

tea "github.com/charmbracelet/bubbletea"
"github.com/muesli/termenv"
"golang.org/x/crypto/ssh"
gossh "golang.org/x/crypto/ssh"
)

Expand Down Expand Up @@ -64,6 +65,10 @@ func shellAndWait(session *gossh.Session) error {
return fmt.Errorf("failed to start shell: %w", err)
}
if err := session.Wait(); err != nil {
if errors.Is(err, &ssh.ExitMissingError{}) {
log.Println("exit was missing, assuming exit 0")
return nil
}
return fmt.Errorf("session failed: %w", err)
}
return nil
Expand Down

0 comments on commit fd88793

Please sign in to comment.