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

Prompt resource doesn't remove cursor when ENTER key is pressed. #117

Closed
richardmcsong opened this issue Nov 18, 2019 · 4 comments · Fixed by coder/coder-v1-cli#265 · May be fixed by #118
Closed

Prompt resource doesn't remove cursor when ENTER key is pressed. #117

richardmcsong opened this issue Nov 18, 2019 · 4 comments · Fixed by coder/coder-v1-cli#265 · May be fixed by #118

Comments

@richardmcsong
Copy link

richardmcsong commented Nov 18, 2019

image
Code:

prompt = promptui.Prompt{
	Label: "Prompt 3",
}
_, err = prompt.Run()

The string that I get back from prompt.Run doesn't include the cursor, though.

@chriszzt
Copy link

chriszzt commented Dec 3, 2019

You could try my fork. I fixed it in some way.
Since it is a bit hacky, I might not create a pr for now.
https://github.com/tigergraph/promptui

@laverya
Copy link

laverya commented Dec 11, 2019

Is the issue just that the length in bytes is different than the length in runes then @chriszzt? Assuming https://github.com/tigergraph/promptui/pull/2/files is the relevant PR and not https://github.com/tigergraph/promptui/pull/1/files, I mean - since 1 was much larger than 2

laverya added a commit to replicatedhq/kots that referenced this issue Dec 11, 2019
see manifoldco/promptui#117

a version override is added for go-i18n to avoid go mod issues
@chriszzt
Copy link

chriszzt commented Dec 11, 2019

https://github.com/tigergraph/promptui/pull/2/files

Oh, actually c.input is of type []rune, that is why I deleted unnecessary type conversion in my pr 2.

By the way, the cursor issue is handled by
https://github.com/tigergraph/promptui/blob/master/prompt.go#L236

@jamesdobson
Copy link
Contributor

Created PR #147 which extracts the commit PR #118 by @richardmcsong that deals specifically with this issue (PR #118 also contains additional functionality), hopefully making PR #147 easier to accept.

Also, PR #147 does pass the CI build, which also hopefully makes it easier to accept.

@jbowes jbowes closed this as completed in c2f558a Sep 28, 2020
jbowes added a commit that referenced this issue Sep 28, 2020
Fixed echo of cursor after input is finished. (fixes #117)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants