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

textinput: add support for wrapping the prompt #483

Open
twpayne opened this issue Feb 24, 2024 · 2 comments
Open

textinput: add support for wrapping the prompt #483

twpayne opened this issue Feb 24, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@twpayne
Copy link
Contributor

twpayne commented Feb 24, 2024

Is your feature request related to a problem? Please describe.

My application uses textinputs with long prompts. The prompts are long because they contain multiple filenames from the user that can get quite long, for example:

$ chezmoi rm ~/.config/git/config
Remove /Users/twp/.config/git/config and /Users/twp/.local/share/chezmoi/home/private_dot_config/git/config.tmpl? yes/no/all/quit

textinput only displays the prompt up to the width of the terminal, which leads to the prompt being truncated and confusing, for example, with a terminal of width 80:

$ chezmoi rm ~/.config/git/config
Remove /Users/twp/.config/git/config and /Users/twp/.local/share/chezmoi/home/pr

Describe the solution you'd like

I'd like a boolean option to wrap the prompt over multiple lines, wrapping words (maybe using github.com/muesli/reflow) so you would get the following with a terminal width of 80:

$ chezmoi rm ~/.config/git/config
Remove /Users/twp/.config/git/config and /Users/twp/.local/share/chezmoi/home/
private_dot_config/git/config.tmpl? yes/no/all/quit

Describe alternatives you've considered

Forking textinput to add this functionality.

Additional context

#417 talks about multiline text, this feature request is about a multiline prompt.

I would happily submit a PR for this if you are interested.

@meowgorithm
Copy link
Member

meowgorithm commented Feb 27, 2024

This all makes sense to me; thanks for the well written writeup, Tom. If this is something you'd indeed like to work on, by all means go for it.

@maaslalani
Copy link
Member

For what it's worth, textarea can support multiline prompts with this PR:

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

No branches or pull requests

3 participants