Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-148321: use --quit-if-one-screen option for the pager (new REPL)
Currently, by passing --clear-screen (-c) to the pager --- small texts (like
few-sentences docstrings) are shown at top of the screen, just as big texts.

I believe it would be better to show this inline instead, not clearing
last session commands with output and so on.  BTW, this is the default
for git commands, e.g. git-log.  Of course, we loose on this way ability
to use pager for search, but terminal emulators usually have similar
capability on its own.
  • Loading branch information
skirpichev committed Apr 10, 2026
commit d772fd9d593d4303a282b17524fdf1d89de63507
2 changes: 1 addition & 1 deletion Lib/_pyrepl/pager.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def pipe_pager(text: str, cmd: str, title: str = '') -> None:
'.'
'?e (END):?pB %pB\\%..'
' (press h for help or q to quit)')
env['LESS'] = '-RcmPm{0}$PM{0}$'.format(prompt_string)
env['LESS'] = '-F-RmPm{0}$PM{0}$'.format(prompt_string)
Comment thread
skirpichev marked this conversation as resolved.
Outdated
proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
errors='backslashreplace', env=env)
assert proc.stdin is not None
Expand Down
Loading