Skip to content

Commit

Permalink
fix command focus and done focus issues with dynamic (non-run) commands
Browse files Browse the repository at this point in the history
  • Loading branch information
sawka committed Mar 20, 2024
1 parent b9e6d0d commit 4590b20
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions wavesrv/pkg/cmdrunner/cmdrunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -1186,9 +1186,17 @@ func deferWriteCmdStatus(ctx context.Context, cmd *sstore.CmdType, startTime tim
err := sstore.UpdateCmdDoneInfo(context.Background(), update, ck, donePk, cmdStatus)
if err != nil {
// nothing to do
log.Printf("error updating cmddoneinfo (in openai): %v\n", err)
log.Printf("error updating cmddoneinfo: %v\n", err)
return
}
screen, err := sstore.UpdateScreenFocusForDoneCmd(ctx, cmd.ScreenId, cmd.LineId)
if err != nil {
log.Printf("error trying to update screen focus type: %v\n", err)
// fall-through (nothing to do)
}
if screen != nil {
update.AddUpdate(*screen)
}
scbus.MainUpdateBus.DoScreenUpdate(cmd.ScreenId, update)
}

Expand Down Expand Up @@ -3686,7 +3694,7 @@ func RemoteResetCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (
if err != nil {
return nil, err
}
update, err := addLineForCmd(ctx, "/reset", false, ids, cmd, "", nil)
update, err := addLineForCmd(ctx, "/reset", true, ids, cmd, "", nil)
if err != nil {
return nil, err
}
Expand All @@ -3695,7 +3703,7 @@ func RemoteResetCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (
}

func doResetCommand(ids resolvedIds, shellType string, cmd *sstore.CmdType, verbose bool) {
ctx, cancelFn := context.WithTimeout(context.Background(), 10*time.Second)
ctx, cancelFn := context.WithTimeout(context.Background(), 20*time.Second)
defer cancelFn()
startTime := time.Now()
var outputPos int64
Expand Down

0 comments on commit 4590b20

Please sign in to comment.