Skip to content

Conversation

@yorickvP
Copy link

@yorickvP yorickvP commented Jun 7, 2025

termui contains a workaround for windows where it prints a readline prompt itself. On linux, this confuses readline so things like backspace/ctrl-backspace and line wrapping don't work correctly.

On platforms other than windows, just let readline handle the prompt.

fixes #2968

Note: while I used claude code to offload some manual work creating this PR, I've steered and reviewed all the changes and take personal responsibility for the contents.

termui contains a workaround for windows where it prints a readline prompt itself. On linux, this
confuses `readline` so things like backspace/ctrl-backspace and line wrapping don't work correctly.

On platforms other than windows, just let readline handle the prompt.
The prompt was still printed to stdout, even when err=True was passed.
Use redirect_stdout to fix this.

Also, update the tests to test for the new behavior.
@yorickvP
Copy link
Author

Rebased out the conflicting version bumps and fixed the stdout/stderr situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

backspace and line-wrapping acting strange on Linux

1 participant