Skip to content

Commit d772fd9

Browse files
committed
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.
1 parent 1a0edb1 commit d772fd9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Lib/_pyrepl/pager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def pipe_pager(text: str, cmd: str, title: str = '') -> None:
138138
'.'
139139
'?e (END):?pB %pB\\%..'
140140
' (press h for help or q to quit)')
141-
env['LESS'] = '-RcmPm{0}$PM{0}$'.format(prompt_string)
141+
env['LESS'] = '-F-RmPm{0}$PM{0}$'.format(prompt_string)
142142
proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
143143
errors='backslashreplace', env=env)
144144
assert proc.stdin is not None

0 commit comments

Comments
 (0)