From 5b1b67cf55d5696e5c00fdcd5104b84cdf0879dd Mon Sep 17 00:00:00 2001 From: sawka Date: Wed, 24 Aug 2022 18:56:50 -0700 Subject: [PATCH] quick fixes --- pkg/cmdrunner/cmdrunner.go | 3 +-- pkg/sstore/updatebus.go | 6 +++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pkg/cmdrunner/cmdrunner.go b/pkg/cmdrunner/cmdrunner.go index d68c29fc7..86a3b6522 100644 --- a/pkg/cmdrunner/cmdrunner.go +++ b/pkg/cmdrunner/cmdrunner.go @@ -332,7 +332,6 @@ func RunCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (sstore.U runPacket.CK = base.MakeCommandKey(ids.SessionId, cmdId) runPacket.Cwd = ids.RemoteState.Cwd runPacket.Env0 = ids.RemoteState.Env0 - fmt.Printf("run-command FOO [%s]\n", shexec.ParseEnv0(ids.RemoteState.Env0)["FOO"]) runPacket.EnvComplete = true runPacket.UsePty = true runPacket.TermOpts = &packet.TermOpts{Rows: remote.DefaultTermRows, Cols: remote.DefaultTermCols, Term: remote.DefaultTerm} @@ -668,7 +667,7 @@ func CrCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (sstore.Up return nil, fmt.Errorf("/cr error: cannot update curremote: %w", err) } update := sstore.ModelUpdate{ - Window: sstore.WindowType{ + Window: &sstore.WindowType{ SessionId: ids.SessionId, WindowId: ids.WindowId, CurRemote: *rptr, diff --git a/pkg/sstore/updatebus.go b/pkg/sstore/updatebus.go index 155db0122..911dd1384 100644 --- a/pkg/sstore/updatebus.go +++ b/pkg/sstore/updatebus.go @@ -24,10 +24,10 @@ func (PtyDataUpdate) UpdateType() string { } type ModelUpdate struct { - Sessions []*SessionType `json:"sessions"` + Sessions []*SessionType `json:"sessions,omitempty"` ActiveSessionId string `json:"activesessionid,omitempty"` - Window WindowType `json:"window"` - Line *LineType `json:"line"` + Window *WindowType `json:"window,omitempty"` + Line *LineType `json:"line,omitempty"` Cmd *CmdType `json:"cmd,omitempty"` CmdLine *CmdLineType `json:"cmdline,omitempty"` Info *InfoMsgType `json:"info,omitempty"`