Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do you hide the cursor after inputting text? + Other stylistic comments #153

Open
mayamshah opened this issue Jun 11, 2020 · 2 comments

Comments

@mayamshah
Copy link

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:
Screen Shot 2020-06-11 at 3 58 24 PM

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)
		}
	}
}

Let me know if there is something I can do.

Thanks,
Maya

@jrslv
Copy link

jrslv commented Jun 28, 2020

Hi, this is fixed in #147

@seyoatda
Copy link

seyoatda commented Jun 7, 2021

Hi, this is fixed in #147

it seems this bug still exists in v0.8.0 , in windows powershell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants