diff --git a/internal/command/console.go b/internal/command/console.go index eed277a4e0..d086bd2ee8 100644 --- a/internal/command/console.go +++ b/internal/command/console.go @@ -65,6 +65,13 @@ func (c *ConsoleCommand) Run(rawArgs []string) int { // operation, but there is no clear path to pass this value down, so we // continue to mutate the Meta object state for now. c.Meta.input = args.ViewOptions.InputEnabled + + // TODO meta-refactor: when the stateLock and stateLockTimeout are extracted to be configured separately, remove + // these and use a common way to configure this + // The stateLock=true is here this way because this command used before meta.extendedFlagSet which did the same + // and left for the command to configure flags for this if needed. + c.Meta.stateLock = true + c.GatherVariables(args.Vars) configPath := c.WorkingDir.NormalizePath(c.WorkingDir.RootModuleDir()) diff --git a/internal/command/console_interactive_test.go b/internal/command/console_interactive_test.go index c0391d3726..afd0d860bd 100644 --- a/internal/command/console_interactive_test.go +++ b/internal/command/console_interactive_test.go @@ -115,6 +115,11 @@ func TestConsole_multiline_interactive(t *testing.T) { if diff := cmp.Diff(got, tc.expected); diff != "" { t.Fatalf("unexpected output. For input: %s\n%s", tc.input, diff) } + + // TODO meta-refactor: remove this assertion once the stateLock from Meta is removed + if !c.Meta.stateLock { + t.Errorf("stateLock should always be nil for this command") + } }) } }