python / python/cpython

Don't call pager with --clear-screen

Open
#148,321 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Bug report

Bug description:

This was recently introduced by https://github.com/python/cpython/pull/146382.

I believe this rather lead to a bad user experience, see https://github.com/python/cpython/pull/146382#issuecomment-4185931124. The screen will be cleared regardless on the text size, even if it's small, like small docstrings. Then you have to scroll up terminal to see recent output and so on.

IMO, it's better to follow git's defaults, which uses --quit-if-one-screen option to display small texts "inline". We could too.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs
  • gh-148322

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

Start by reviewing linked PR gh-148322 and the changes introduced by PR 146382, then trace where CPython invokes the pager for small docstrings. Done means small text stays inline while longer output still uses the pager without clearing the terminal; add or update the relevant tests if that work is not already covered.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.