mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Fix exit command in console interactive mode (#2086)
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
This commit is contained in:
parent
384dc4cb93
commit
810df00376
@ -57,12 +57,11 @@ func (c *ConsoleCommand) modeInteractive(session *repl.Session, ui cli.Ui) int {
|
||||
// brackets we know not to execute the command just yet
|
||||
fullCommand, openState := consoleState.UpdateState(line)
|
||||
|
||||
switch {
|
||||
case openState > 0:
|
||||
if openState > 0 {
|
||||
// here there are open brackets somewhere, so we don't execute it
|
||||
// as we are in a bracket we update the prompt. we use one . per layer pf brackets
|
||||
l.SetPrompt(fmt.Sprintf("%s ", strings.Repeat(".", openState)))
|
||||
default:
|
||||
} else {
|
||||
out, exit, diags := session.Handle(fullCommand)
|
||||
if diags.HasErrors() {
|
||||
c.showDiagnostics(diags)
|
||||
|
Loading…
Reference in New Issue
Block a user