Use a pager for displaying usage, matches kitty behavior

Also dont tell less to squeeze lines
This commit is contained in:
Kovid Goyal
2022-08-15 13:45:05 +05:30
parent 46840df1ad
commit c04b002d4e
2 changed files with 66 additions and 78 deletions

View File

@@ -474,7 +474,7 @@ class PrintHelpForSeq:
text = '\n'.join(blocks) + '\n\n' + version()
if print_help_for_seq.allow_pager and sys.stdout.isatty():
import subprocess
p = subprocess.Popen(['less', '-isRXF'], stdin=subprocess.PIPE, preexec_fn=clear_handled_signals)
p = subprocess.Popen(['less', '-iRXF'], stdin=subprocess.PIPE, preexec_fn=clear_handled_signals)
try:
p.communicate(text.encode('utf-8'))
except KeyboardInterrupt: