From dc78e4cb658902131f1440042359289732b1bb65 Mon Sep 17 00:00:00 2001 From: redhat <2292650292@qq.com> Date: Wed, 21 May 2025 19:14:12 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81change=20tty=20default=20sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- controller/websocket.go | 2 +- pkg/observe/observe.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/controller/websocket.go b/controller/websocket.go index 2ac3fbf..1b72a47 100644 --- a/controller/websocket.go +++ b/controller/websocket.go @@ -30,7 +30,7 @@ func TerminalHandle() func(c *gin.Context) error { } defer conn.Close() - cmd := exec.Command("bash") + cmd := exec.Command("sh") ptyFile, err := pty.Start(cmd) if err != nil { log.Sugar().Errorf("Failed to start pty: %v", err) diff --git a/pkg/observe/observe.go b/pkg/observe/observe.go index 3030f13..d423aae 100644 --- a/pkg/observe/observe.go +++ b/pkg/observe/observe.go @@ -50,12 +50,12 @@ func (b *baseEventBus) Unsubscribe(key string, ob Observer) { } type SyncEventBus struct { - baseEventBus + *baseEventBus } func NewSyncEventBus() *SyncEventBus { return &SyncEventBus{ - baseEventBus: *newBaseEventBus(), + baseEventBus: newBaseEventBus(), } } @@ -81,7 +81,7 @@ func (s *SyncEventBus) handleErr(_ context.Context, errs map[Observer]error) { } type AsyncEventBus struct { - baseEventBus + *baseEventBus errC chan *observerWithErr celFn context.CancelFunc ctx context.Context @@ -94,7 +94,7 @@ type observerWithErr struct { func NewAsyncEventBus() *AsyncEventBus { res := &AsyncEventBus{ - baseEventBus: *newBaseEventBus(), + baseEventBus: newBaseEventBus(), } res.errC = make(chan *observerWithErr)