python / python/cpython

pyrepl loses input and mis-positions cursor when F2 is pressed

Open
#124,874 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.13 3.14 topic-repl type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Bug report

Bug description:

image
image
image

This is bad for 2 different reasons:

  1. pyrepl loses track of the cursor, thinking it's in the first column when it's actually in the middle of the screen somewhere, so future screen drawing operations have unexpected results
  2. on top of that, anything you were in the middle of typing when you pressed F2 is discarded, so if you wanted to access the history to copy something out and paste it into the command you're writing, oops, it's gone
CPython versions tested on:

3.13

Operating systems tested on:

Linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the F2 behavior in pyrepl on Linux with CPython 3.13, then trace the F2 handling and screen redraw path. Done means the current input is preserved, the cursor remains correctly positioned, and subsequent screen drawing behaves normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.