We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7067f9a commit 041be8bCopy full SHA for 041be8b
pkg/terminal/terminal.go
@@ -77,7 +77,7 @@ func (t *Terminal) ForceRedraw() {
77
}
78
79
// Run starts the terminal/shell proxying process
80
-func (t *Terminal) Run() error {
+func (t *Terminal) Run(commands ...string) error {
81
82
if !t.enableNesting {
83
if os.Getenv("SHOX") != "" {
@@ -137,6 +137,10 @@ func (t *Terminal) Run() error {
137
138
defer func() { _ = terminal.Restore(int(os.Stdin.Fd()), oldState) }() // Best effort.
139
140
+ for _, command := range commands {
141
+ _, _ = t.pty.Write([]byte(command + "\n"))
142
+ }
143
+
144
// Copy stdin to the pty and the pty to stdout.
145
go func() { _ = lazyCopy(t.pty, os.Stdin) }()
146
go func() { _ = lazyCopy(os.Stdout, t.proxy, t.hideAllOutput) }()
0 commit comments