Skip to content

gh-145649: Fix man page text wrapping for -X option#145656

Merged
vstinner merged 4 commits into
python:mainfrom
mvanhorn:osc/145649-fix-man-page-x-option
Mar 16, 2026
Merged

gh-145649: Fix man page text wrapping for -X option#145656
vstinner merged 4 commits into
python:mainfrom
mvanhorn:osc/145649-fix-man-page-x-option

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

Fixes #145649.

The -X option descriptions in the man page (Misc/python.man) used hardcoded space indentation for sub-options. Troff treats lines starting with spaces as preformatted text that does not wrap, causing the descriptions to break incorrectly at narrow terminal widths - words would split across lines at the left margin instead of reflowing within the indented block.

This replaces the inline indentation with proper troff macros:

  • .TP for each -X sub-option (tagged paragraph with the option as label)
  • .RS/.RE for nesting the sub-options within the parent -X entry
  • .IP with bullet markers for the -X dev feature list

The descriptions now flow and wrap correctly at any terminal width, matching the style used by other options in the same man page.

This contribution was developed with AI assistance (Claude Code).

Replace hardcoded space indentation with proper troff macros
(.TP, .RS/.RE, .IP) for -X sub-options so text wraps correctly
at any terminal width.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@python-cla-bot

python-cla-bot Bot commented Mar 9, 2026

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app

bedevere-app Bot commented Mar 9, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

mvanhorn and others added 3 commits March 8, 2026 20:50
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. I don't speak roff markup, but the output looks correct.

I tested with man Misc/python.man on Linux.

@mvanhorn

Copy link
Copy Markdown
Contributor Author

Thanks for taking a look!

@vstinner vstinner merged commit 36b5284 into python:main Mar 16, 2026
32 checks passed
@vstinner vstinner added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Mar 16, 2026
@miss-islington-app

Copy link
Copy Markdown

Thanks @mvanhorn for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Thanks @mvanhorn for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @mvanhorn and @vstinner, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 36b5284f04b0a946a7d915bcd656534c9b4dbd85 3.13

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 16, 2026
…45656)

Replace hardcoded space indentation with proper troff macros
(.TP, .RS/.RE, .IP) for -X sub-options so text wraps correctly
at any terminal width.
(cherry picked from commit 36b5284)

Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@bedevere-app

bedevere-app Bot commented Mar 16, 2026

Copy link
Copy Markdown

GH-146015 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Mar 16, 2026
@vstinner

Copy link
Copy Markdown
Member

Thanks, I merged your PR. I backported it to 3.14.

@vstinner vstinner removed the needs backport to 3.13 bugs and security fixes label Mar 16, 2026
vstinner pushed a commit that referenced this pull request Mar 16, 2026
#146015)

gh-145649: Fix man page text wrapping for -X option (GH-145656)

Replace hardcoded space indentation with proper troff macros
(.TP, .RS/.RE, .IP) for -X sub-options so text wraps correctly
at any terminal width.
(cherry picked from commit 36b5284)

Co-authored-by: Matt Van Horn <mvanhorn@users.noreply.github.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@ryan-duve

Copy link
Copy Markdown
Contributor

Thank you both @mvanhorn and @vstinner!

@mvanhorn

Copy link
Copy Markdown
Contributor Author

Thanks for the review and merge, @vstinner!

ljfp pushed a commit to ljfp/cpython that referenced this pull request Apr 25, 2026
)

Replace hardcoded space indentation with proper troff macros
(.TP, .RS/.RE, .IP) for -X sub-options so text wraps correctly
at any terminal width.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Man Page Text Wraps for -X option

3 participants