From 8b11af682227ab6eec8e192b5dccf6ac4c4d45d2 Mon Sep 17 00:00:00 2001 From: sawka Date: Wed, 31 Aug 2022 00:01:42 -0700 Subject: [PATCH] add non-parsing commands to history --- pkg/cmdrunner/cmdrunner.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkg/cmdrunner/cmdrunner.go b/pkg/cmdrunner/cmdrunner.go index 09cb9b2e..1d42ccb7 100644 --- a/pkg/cmdrunner/cmdrunner.go +++ b/pkg/cmdrunner/cmdrunner.go @@ -201,19 +201,19 @@ func EvalCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (sstore. if len(pk.Args) == 0 { return nil, fmt.Errorf("usage: /eval [command], no command passed to eval") } - newPk, err := EvalMetaCommand(ctx, pk) - if err != nil { - return nil, err + var update sstore.UpdatePacket + newPk, rtnErr := EvalMetaCommand(ctx, pk) + if rtnErr == nil { + update, rtnErr = HandleCommand(ctx, newPk) } - update, err := HandleCommand(ctx, newPk) if !resolveBool(pk.Kwargs["nohist"], false) { - err := addToHistory(ctx, pk, update, (newPk.MetaCmd != "run"), (err != nil)) + err := addToHistory(ctx, pk, update, (newPk.MetaCmd != "run"), (rtnErr != nil)) if err != nil { fmt.Printf("[error] adding to history: %v\n", err) // continue... } } - return update, err + return update, rtnErr } func ScreenCloseCommand(ctx context.Context, pk *scpacket.FeCommandPacketType) (sstore.UpdatePacket, error) {