I am using the latest version of promptui.
I created a REPL and I am using promptui to grab the users input. However after every new input the cursor doesn't disappear. I've looked through the documentation but I am unsure how to fix this issue.
Here is what my shell looks like:
I also noticed randomly sometimes when I input a string, the output is given twice. (this happens randomly, but an example is when "banana" was entered in the above screenshot)
I also noticed sometimes "op:" is greyed out, and sometimes it keeps the green check.
Do you know how to fix these issues?
Here is the code that is running promptui:
func Run(execute bool) {
t := tool_chain.NewOpToolChain()
for true {
validate_exp := func (input string) error {
_,_,_, err := t.Parse(input)
return err
}
prompt := promptui.Prompt{
Label: "op",
Validate: validate_exp,
}
result, err := prompt.Run()
if err != nil {
fmt.Printf("Prompt failed %v\n", err)
return
}
//exits the interative cli if user specifies
if result == `exit` {
fmt.Printf("CLI exiting gracefully...")
break
//executes the command given
} else {
fmt.Printf("Command entered: %q\n", result)
}
}
}
Hi,
I am using the latest version of promptui. I created a REPL and I am using promptui to grab the users input. However after every new input the cursor doesn't disappear. I've looked through the documentation but I am unsure how to fix this issue.
Here is what my shell looks like:
I also noticed randomly sometimes when I input a string, the output is given twice. (this happens randomly, but an example is when "banana" was entered in the above screenshot)
I also noticed sometimes "op:" is greyed out, and sometimes it keeps the green check. Do you know how to fix these issues?
Here is the code that is running promptui:
Let me know if there is something I can do.
Thanks, Maya