_pyrepl/pager.py: call less with --clear-screen#146382
Conversation
|
Thank you for your contribution! :) |
|
Thanks for your merge! |
|
Sorry, @StanFromIreland, it doesn't look as a cosmetic change. IMO, it's a regression, which introduces rather unhelpful behavior of the REPL. So, for small docstring - you can see all nearby repl interaction without scrolling. BTW, in the real world - my console size would be much bigger. So, more wasted space... Maybe we could solve your issue (if it exists at all) in a different way? BTW, why to keep pager at all for small texts? I think that git tools do this per default only if text doesn't fit to the screen ( The patch: diff --git a/Lib/_pyrepl/pager.py b/Lib/_pyrepl/pager.py
index 92afaa5933a..f937d7973d8 100644
--- a/Lib/_pyrepl/pager.py
+++ b/Lib/_pyrepl/pager.py
@@ -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)
proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
errors='backslashreplace', env=env)
assert proc.stdin is not NoneThe behavior for git tools could be customized, i.e. they respect the |
You are right, this happens only if you near of the bottom of the screen. Though, it's a sort of common case in a long REPL session. BTW, with added
No, it was linux. |



Since this is only a cosmetic change, I don't think it qualifies for a news entry.
Currently, text is written bottom-to-top, resulting in odd placement for
copyright():This patch fixes that:
By passing
--clear-screen(-c) toless, which "causes full screen repaints to be painted from the top line down."