pgcli icon indicating copy to clipboard operation
pgcli copied to clipboard

pgcli disconnects when closing pager with `q`

Open zzantares opened this issue 2 years ago • 5 comments

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.0 installed via nix.

zzantares avatar Oct 05 '23 21:10 zzantares

@zzantares What is your PAGER variable set to?

j-bennet avatar Oct 07 '23 01:10 j-bennet

@zzantares What is your PAGER variable set to?

$ echo $PAGER
less

@j-bennet thank you for looking into this!

zzantares avatar Oct 07 '23 05:10 zzantares

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

j-bennet avatar Oct 08 '23 00:10 j-bennet

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```

traleig1 avatar Jun 29 '24 21:06 traleig1

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!)

dbaty avatar Jun 30 '24 14:06 dbaty