From a20ee78e6d33a83615925861c16a3e1bc84476e4 Mon Sep 17 00:00:00 2001 From: sawka Date: Mon, 5 Sep 2022 14:54:17 -0700 Subject: [PATCH] send line update via websocket synchronously before calling the cmdwait callback. ensures line arrives on fe client before any command updates or pty updates --- pkg/cmdrunner/cmdrunner.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/cmdrunner/cmdrunner.go b/pkg/cmdrunner/cmdrunner.go index 4e46e762..f74c8a04 100644 --- a/pkg/cmdrunner/cmdrunner.go +++ b/pkg/cmdrunner/cmdrunner.go @@ -191,7 +191,9 @@ func RunCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (sstore.U if err != nil { return nil, err } - return sstore.ModelUpdate{Line: rtnLine, Cmd: cmd}, nil + update := sstore.ModelUpdate{Line: rtnLine, Cmd: cmd, Interactive: pk.Interactive} + sstore.MainBus.SendUpdate(ids.SessionId, update) + return nil, nil } func addToHistory(ctx context.Context, pk *scpacket.FeCommandPacketType, update sstore.UpdatePacket, isMetaCmd bool, hadError bool) error {