pgcli icon indicating copy to clipboard operation
pgcli copied to clipboard

Allow setting a pager with flag

Open aristidebm opened this issue 8 months ago • 1 comments

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(...)

aristidebm avatar Jun 14 '25 19:06 aristidebm

@aristidebm Thanks for reporting. We had to downgrade click because it was breaking our integration tests:

https://github.com/dbcli/pgcli/commit/d1ebd5ce952a04880fc397cbc42d16138a517b6a

Looks like we have to find a different solution, though.

j-bennet avatar Jun 20 '25 17:06 j-bennet