Skip to content

Resolve the pager command once, in _pager_contextmanager - #3776

Merged
Rowlando13 merged 1 commit into
pallets:mainfrom
kdeldycke:dedup-pager-command-resolution
Aug 18, 2026
Merged

Rowlando13 merged 1 commit into
pallets:mainfrom
kdeldycke:dedup-pager-command-resolution

Conversation

@kdeldycke

Copy link
Copy Markdown
Collaborator

Following the refactor of #3767, I just noticed an opportunity to deduplicate the shutil.which call that appears both in _pipepager() and _tempfilepager(). These methods are were already a source of a lot of tweaking these past few years so this should make them more readable.

Also used the opportunity to remove unnecessary if color is None: color = False lines which made superfluous normalization inside each strategy. The color interpretation is already handled by the new _PagerWriter.

@kdeldycke kdeldycke added the help output Help text formatting, layout, and --help rendering label Aug 18, 2026
@kdeldycke kdeldycke added this to the 8.5.0 milestone Aug 18, 2026
@kdeldycke kdeldycke added prompt Interactive input and confirmation and removed help output Help text formatting, layout, and --help rendering labels Aug 18, 2026
@kdeldycke kdeldycke added the windows Windows-specific behavior label Aug 18, 2026
@Rowlando13
Rowlando13 merged commit 61b69e9 into pallets:main Aug 18, 2026
12 checks passed
@kdeldycke
kdeldycke deleted the dedup-pager-command-resolution branch August 19, 2026 03:57
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

prompt Interactive input and confirmation windows Windows-specific behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants