Skip to content

Allow setting a pager with flag #1514

@aristidebm

Description

@aristidebm

Thank you guys for this very useful piece of software and all the time and effort put in mainting it.

Here is my usecase, I want to set my pager to what is recommended here pspg with a slight modification, but it does not work

pager = /usr/bin/pspg --clipboard-app=2 --rr=2 --quit-if-one-screen --ignore-case

After some time spent on understanding why it does not work, I have discovered that the problem is due to the version of click that pgcli is using, in version 8.1.x of click, the pager was not assumed to accept flags. This is what I have on my system in click code base

Image

This is what we now have on click main branch

Image
https://github.com/pallets/click/blob/main/src/click/_termui_impl.py#L412

In new versions of click the cmd is sanitize with shlex.split(...) to separate the actual command from flags before calling the shutil.which(...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions