Skip to content

backspace and line-wrapping acting strange on Linux #2968

@yorickvP

Description

@yorickvP

When running any app using click.prompt on linux, something weird happens with backspace.

Recording

This screen recording shows 2 letters being removed when I hit backspace once, and the prompt being deleted when I backspace the entire line.

Image
(asciinema link)

The returned input is also different from the text shown on screen.

Environment:

  • Python version: 3.13.3
  • Click version: 8.2.1

Cause:

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.

This can be fixed by letting readline handling the prompt on linux: #2969

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions