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

Newline \n in message breaks line wrap in terminal #398

Open
1 task done
sisp opened this issue Sep 9, 2024 · 3 comments
Open
1 task done

Newline \n in message breaks line wrap in terminal #398

sisp opened this issue Sep 9, 2024 · 3 comments
Labels
Bug Something isn't working

Comments

@sisp
Copy link
Contributor

sisp commented Sep 9, 2024

Describe the bug

When using the newline character \n in the question's message, then a long message does not get wrapped according to the terminal width anymore. In my case, we add a trailing newline character to the message to always receive the answer in the next line.

This is a screenshot of the unwrapped message:

screenshot

The behavior has been verified on Linux (Ubuntu 22.04, GNU bash 5.1.16) and macOS.

Example

import questionary

questionary.text(message="Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua\n.").ask()

Steps to reproduce

No response

Expected behaviour

Line wrap should work despite newline characters \n in the message.

Latest version

  • I have checked that this issue occurs on the latest version of questionary.

Questionary version

2.0.1

Prompt Toolkit version

3.0.36

Operating System

Linux

@Sarah1103
Copy link

Sarah1103 commented Oct 18, 2024

Hello @tmbo

Could you please assign this issue to me ?

Thank you !

@sisp
Copy link
Contributor Author

sisp commented Oct 18, 2024

@Sarah1103 I'm not a member of this project, so I have no permissions to set assignees. But please feel free to contribute a fix anyway.

@kiancross
Copy link
Collaborator

Hi @Sarah1103. Please feel free to just work on this issue (or any other issues you like) and submit a PR when you are done. It sometimes takes me a little while to review, but I will eventually and if it passes all tests etc. will get merged in. Thank you for offering to help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants