Skip to content

How to safely Exec any (non bubbletea) programs but maintain rendering #250

Answered by caarlos0
zachatrocity asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, I believe that if you use wish.Command it should work.

wish.Command will create a PTY and run the command within it.

That said, you can probably remove the that custom handler entirely, you just need to ssh -t (to request a tty) and then the original bubbletea handler will do the trick :)

ssh -t -p 23234 localhost -- hello world

Hope that helps.


diff --git a/main.go b/main.go
index ed80a5f..0642607 100644
--- a/main.go
+++ b/main.go
@@ -5,7 +5,6 @@ import (
 	"errors"
 	"net"
 	"os"
-	"os/exec"
 	"os/signal"
 	"syscall"
 	"time"
@@ -48,26 +47,6 @@ func main() {
 				}, []tea.ProgramOption{tea.WithAltScreen()}
 			}),
 			activeterm.Middleware(),
-			func(next ssh.Handler) ssh.Handler {

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by zachatrocity
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants