pgcli icon indicating copy to clipboard operation
pgcli copied to clipboard

Unable to toggle Expanded Display if "expand = True" set in config file

Open jwarner112 opened this issue 3 years ago • 0 comments

Description

Within the ~/.config/pgcli/config file, the following line is set:

# Enables expand mode, which is similar to `\x` in psql.
expand = True

In psql, regardless of the initial setting of \x, I'm able to toggle it by using \x in the session. pgcli things it can do this, too:

Expanded display is on.
Time: 0.000s
jwarner@database> \x
Expanded display is off.
Time: 0.000s
jwarner@database> \x
Expanded display is on.
Time: 0.000s
jwarner@database> \x
Expanded display is off.
Time: 0.000s
jwarner@database>

However, if expand = True (and auto_expand = False) is set in the config file, the \x toggle appears to do nothing.

Server: PostgreSQL 8.0.2
Version: 3.2.0
Home: http://pgcli.com
jwarner@database> SELECT addressable_type, count(*) FROM addresses GROUP BY addressable_type;
-[ RECORD 1 ]-------------------------
addressable_type | TypeA
count            | 32
-[ RECORD 2 ]-------------------------
addressable_type | TypeB
count            | 64
-[ RECORD 3 ]-------------------------
addressable_type | TypeC
count            | 128
-[ RECORD 4 ]-------------------------
addressable_type | TypeD
count            | 256
SELECT
Time: 0.154s
jwarner@database> \x
Expanded display is on.
Time: 0.000s
jwarner@database> SELECT addressable_type, count(*) FROM addresses GROUP BY addressable_type;
-[ RECORD 1 ]-------------------------
addressable_type | TypeA
count            | 32
-[ RECORD 2 ]-------------------------
addressable_type | TypeB
count            | 64
-[ RECORD 3 ]-------------------------
addressable_type | TypeC
count            | 128
-[ RECORD 4 ]-------------------------
addressable_type | TypeD
count            | 256
SELECT
Time: 0.151s
jwarner@database>

Your environment

OS version: macOS Big Sur 11.6.2 pgcli version. 3.2.0 (from Homebrew)

pgcli's Python environment:

$ /usr/local/Cellar/pgcli/3.2.0/libexec/bin/python3.9 -m pip freeze
cli-helpers==2.1.0
click==8.0.1
configobj==5.0.6
gpg==1.16.0
pendulum @ file:///private/tmp/pgcli--pendulum-20210823-82088-w9kqqj/pendulum-2.1.2
pgcli @ file:///private/tmp/pgcli-20210823-82088-1dqwpve/pgcli-3.2.0
pgspecial==1.13.0
prompt-toolkit @ file:///private/tmp/pgcli--prompt-toolkit-20210823-82088-e2u4e3/prompt_toolkit-3.0.20
psycopg2==2.9.1
Pygments==2.10.0
python-dateutil @ file:///private/tmp/pgcli--python-dateutil-20210823-82088-t4po39/python-dateutil-2.8.2
pytzdata @ file:///private/tmp/pgcli--pytzdata-20210823-82088-1my12gi/pytzdata-2020.1/dist/pytzdata-2020.1-py2.py3-none-any.whl
setproctitle @ file:///private/tmp/pgcli--setproctitle-20210823-82088-l36v2k/setproctitle-1.2.2
six==1.16.0
sqlparse==0.4.1
tabulate==0.8.9
terminaltables==3.1.0
wcwidth==0.2.5

jwarner112 avatar Jan 10 '22 22:01 jwarner112