Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-65824: Improve help() when MANPAGER and PAGER variables are not set#21520

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@ZackerySpytz
Copy link
Contributor

@ZackerySpytzZackerySpytz commentedJul 17, 2020
edited by bedevere-appbot
Loading

Display "(q to quit)" when using help(). Use the --quit-at-eof
option to make less quit if enter is pressed on the last line.

https://bugs.python.org/issue21625

Display "(q to quit)" when using help().  Use the --quit-at-eofoption to make less quit if enter is pressed on the last line.
returnlambdatext:tempfilepager(plain(text),'more <')
ifhasattr(os,'system')andos.system('(less) 2>/dev/null')==0:
returnlambdatext:pipepager(text,'less')
cmd='less "-P?e(END) .(q to quit)" --quit-at-eof'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do also considering adding the-X and-F (latter is the same as--quit-if-one-screen) flags.

From the less documentation,

-X causes less to not clear screen upon quit

-X or --no-initDisables sending the termcap initialization and deinitialization strings to the terminal. This is sometimes desirable if the deinitialization string does something unnecessary, like clearing the screen.

and with -F, it quits if the help fits in one screen

-F or --quit-if-one-screenCauses less to automatically exit if the entire file can be displayed on the first screen.
Suggested change
cmd='less "-P?e(END) .(q to quit)" --quit-at-eof'
cmd='less "-P?e(END) .(q to quit)" -X --quit-if-one-screen --quit-at-eof'

@@ -0,0 +1,2 @@
When the ``MANPAGER`` and ``PAGER`` environment variables are not set,
interactive:func:`help` now quits if enter is pressed on the last line.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Also add info about "(q to quit)" message on the status line?

@erlend-aaslanderlend-aasland changed the titlebpo-21625: Improve help() when MANPAGER and PAGER variables are not setgh-65824: Improve help() when MANPAGER and PAGER variables are not setJan 5, 2024
@serhiy-storchaka
Copy link
Member

See also#116050.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@nagarajannagarajannagarajan left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@ZackerySpytz@serhiy-storchaka@nagarajan@the-knights-who-say-ni@ezio-melotti@bedevere-bot@erlend-aasland

[8]ページ先頭

©2009-2025 Movatter.jp