pgcli
pgcli copied to clipboard
pgcli disconnects when closing pager with `q`
Description
Whenever I run a query that returns lots of rows the pager (less) gets activated (this is fine) if I then press q to exit the pager, then pgcli exits altogether and I end up having to reconnect to go back into the pgcli prompt. Is there something I need to configure to not have this behavior?
environment
- Please provide your OS and version information:
Ubuntu 22.04.3 LTS jammy - Please provide your CLI version:
Version: 3.5.0installed vianix.
@zzantares What is your PAGER variable set to?
@zzantares What is your
PAGERvariable set to?
$ echo $PAGER
less
@j-bennet thank you for looking into this!
Hmm, looks like we had this for a while, and not everyone is seeing this. This user only has an issue with one particular table:
- https://github.com/dbcli/pgcli/issues/1132
I've just started getting this issue with one specific table on version 4.01 on NixOS unstable.
➜ ~ pgcli --version
Version: 4.0.1
➜ ~ nix-info -m
- system: `"x86_64-linux"`
- host os: `Linux 6.9.4, NixOS, 24.11 (Vicuna), 24.11.20240613.e9ee548`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.18.2`
- channels(root): `"nixos"`
- nixpkgs: `/nix/store/qqwr649pc0qprc9lw2fmdsi1km6p7q2h-source`
➜ ~ echo $PAGER
less
➜ ~ echo $LESS
-R```
One user mentioned in sibling issue (#1132) that they only see this with a particular query, like you did. Do you think you could try to pinpoint the cause? Do all queries on the problematic table show the error? If only a particular query yields the error, what if you exclude some rows? What if you exclude some columns? Perhaps the issue comes from a particular character, or suite of characters, or lines of a certain length, or... something else? :)
Also, could you indicate your version of less (available with less --version)?
(I am supposing that you cannot just export the data. But if you could, someone else could also take a look!)