Skip to content

Commit 5c4aab2

Browse files
willmcguganflorentx
authored andcommitted
Fix readline support on Linux
bug #4135
1 parent 46cebbb commit 5c4aab2

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Fixed
11+
12+
- Fixed `readline` support: correct cursor position https://github.com/Textualize/rich/pull/4135
13+
814
## [15.0.0] - 2026-04-12
915

1016
### Changed

CONTRIBUTORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ The following people have contributed to the development of Rich:
9898
- [chthollyphile](https://github.com/chthollyphile)
9999
- [Jonathan Helmus](https://github.com/jjhelmus)
100100
- [Brandon Capener](https://github.com/bcapener)
101+
- [Florent Xicluna](https://github.com/florentx)
101102
- [Alex Zheng](https://github.com/alexzheng111)
102103
- [Sebastian Speitel](https://github.com/SebastianSpeitel)
103104
- [Kevin Turcios](https://github.com/KRRT7)

rich/console.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2186,7 +2186,8 @@ def input(
21862186
if stream:
21872187
result = stream.readline()
21882188
else:
2189-
result = input()
2189+
# Fix readline support: pass a non-empty string
2190+
result = input(" \b") # SPACE + BACKSPACE
21902191
return result
21912192

21922193
def export_text(self, *, clear: bool = True, styles: bool = False) -> str:

0 commit comments

Comments
 (0)