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

Questions are cropped, not wrapped, if the terminal is not wide enough #1764

Closed
abelsiqueira opened this issue Sep 5, 2024 · 2 comments
Closed
Labels
bug triage Trying to make sure if this is valid or not

Comments

@abelsiqueira
Copy link

Describe the problem

If the terminal is not wider than the question, the question is cropped. We expected it to be wrapped.

First reported in abelsiqueira/BestieTemplate.jl#422, but reproduced below:

image

Template

https://github.com/abelsiqueira/BestieTemplate.jl

To Reproduce

copier copy https://github.com/abelsiqueira/BestieTemplate.jl Tmp.jl

Logs

No response

Expected behavior

Long question should be wrapped so fit the width of the terminal.

Screenshots/screencasts/logs

image

image

Operating system

macOS

Operating system distribution and version

16.1

Copier version

9.3.1

Python version

3.12.3

Installation method

pipx+pypi

Additional context

No response

@abelsiqueira abelsiqueira added bug triage Trying to make sure if this is valid or not labels Sep 5, 2024
@sisp
Copy link
Member

sisp commented Sep 9, 2024

Thanks for reporting this problem, @abelsiqueira! 🙏

I've been able to reproduce it on Ubuntu 22.04. The problem occurs because Copier ends help messages with \n (and a whitespace, but that doesn't matter) to receive the user's answer in the next line. We use the questionary library for terminal prompting, and it seems the problem is caused either there or further upstream in prompt-toolkit:

import questionary

questionary.text(message="UUID (For existing packages, copy the UUID from Project.toml, otherwise use the one generated below)").ask()
# vs.
questionary.text(message="UUID (For existing packages, copy the UUID from Project.toml, otherwise use the one generated below)\n").ask()

I've raised an issue in the questionary project: tmbo/questionary#398

@yajo
Copy link
Member

yajo commented Sep 21, 2024

I guess we can close here because, when questionary fixes it and we update, it'll just work, and there's nothing to do here in the mean time, right?

@yajo yajo closed this as completed Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug triage Trying to make sure if this is valid or not
Projects
None yet
Development

No branches or pull requests

3 participants