GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix readline backspace/line-wrapping on linux by yorickvP · Pull Request #2969 · pallets/click

Conversation

@yorickvP

@yorickvP yorickvP commented Jun 7, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

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.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
This was referenced Jun 7, 2025
Use click.visible_prompt_func directly instead of prompt() to fix edi… simonw/llm#940
Closed
minor quirks in chat w/ new readline functionality simonw/llm#356
Open
Problem with overwriting in "llm chat" line wrapping simonw/llm#582
Open
@yorickvP yorickvP mentioned this pull request Jun 16, 2025
backspace and line-wrapping acting strange on Linux #2968
Closed
@yorickvP
yorickvP force-pushed the main branch from e296f92 to 569e20d Compare September 20, 2025 08:40
@yorickvP

yorickvP commented Sep 20, 2025

Copy link
Copy Markdown
Contributor Author

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@yorickvP
yorickvP force-pushed the main branch from 0aadb4d to 7f14581 Compare September 20, 2025 08:59
@jan-swiecki

jan-swiecki commented Dec 9, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

I confirm that it resolves prompt backspace problems in llm (simonw/llm#356)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke
kdeldycke changed the base branch from main to stable April 16, 2026 09:33
@kdeldycke kdeldycke added bug prompt Interactive input and confirmation labels Apr 22, 2026
@kdeldycke kdeldycke added this to the 8.4.0 milestone Apr 22, 2026
@kdeldycke

kdeldycke commented Apr 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

I confirm this issue and the patch, which has been hinted at in #3021 and #3019. I noticed there the coupling of both prompt() / confirm() but could not make sense of their behavior. Until I saw this PR. This is the right fix but need to also apply to confirm(). I will amend this PR to fix both.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke
kdeldycke force-pushed the main branch from 7f14581 to ab87318 Compare April 22, 2026 13:52
@kdeldycke

kdeldycke commented Apr 22, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Collaborator

@yorickvP : I just generalized your fix into a new _readline_prompt helper so both prompt() and confirm() benefits from it. Also squashed all the commit and rebased it on top of stable. Added some tests to confirm that <stdout> is no longer polluted.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kdeldycke
kdeldycke force-pushed the main branch from ab87318 to a919b96 Compare April 22, 2026 13:57
@kdeldycke
kdeldycke requested review from Rowlando13 and davidism April 27, 2026 15:01
Rowlando13
Rowlando13 reviewed Apr 29, 2026
View reviewed changes
Comment thread CHANGES.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Rowlando13
Rowlando13 changed the base branch from stable to main April 29, 2026 07:05
@kdeldycke
kdeldycke force-pushed the main branch from a919b96 to 987174b Compare April 29, 2026 09:20
@yorickvP @kdeldycke
Fix readline backspace and line-wrapping on non-Windows
6677867
Apply fix to prompt() and confirm(), which were covered in pallets#1836, pallets#2093 and pallets#3019

Co-authored-by: Kevin Deldycke <[email protected]>
@kdeldycke
kdeldycke force-pushed the main branch from 987174b to 6677867 Compare April 29, 2026 09:22
davidism
davidism approved these changes Apr 29, 2026
View reviewed changes
@AndreasBackx
AndreasBackx merged commit 2468b70 into pallets:main Apr 29, 2026
11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@AndreasBackx

AndreasBackx commented Apr 29, 2026

Copy link
Copy Markdown
Collaborator

Thanks again @yorickvP for these fixes. Also thank you @kdeldycke for the small cleanup and rebase.

kdeldycke reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@kdeldycke kdeldycke kdeldycke left review comments
@Rowlando13 Rowlando13 Rowlando13 left review comments
@davidism davidism davidism approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

prompt Interactive input and confirmation

Projects

None yet

Milestone

8.4.0

Development

Successfully merging this pull request may close these issues.

backspace and line-wrapping acting strange on Linux

Uh oh!

There was an error while loading. Please reload this page.

6 participants

@yorickvP @jan-swiecki @kdeldycke @AndreasBackx @davidism @Rowlando13
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.