-
Notifications
You must be signed in to change notification settings - Fork 713
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
You can input multiline text in TextArea
when multiline=False
#1894
Comments
It seems that the problem is: there is no "paste" event on Windows, and prompt-toolkit will try to guess a paste event when getting multiline text:
However, since it is just a guess, it is not reliable. When the app is slow responding and the user presses enter multiple times, these chars will be treated as a paste event. To avoid this behavior, add this line after creating the app: app.input.console_input_reader.recognize_paste = False
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The app:
When
multiline=False
, pressing enter should triggeraccept_handler
.However, when pasting multi-line text to the console,
TextArea
draws a new line then scroll down. In this case,accept_handler
won't be triggered.Another way to trigger this bug is to type very fast when the computer is slow. I guess it works similarly as copy-pasting.
Windows 10
prompt_toolkit 3.0.47
cmd.exe + Windows Terminal
The text was updated successfully, but these errors were encountered: