dbcli / pgcli

Postgres CLI with autocompletion and syntax highlighting
http://pgcli.com
BSD 3-Clause "New" or "Revised" License
12.06k stars 553 forks source link

\! <command> not works or missing #1220

Open sys-walker opened 3 years ago

sys-walker commented 3 years ago

Description

When I tried to use the native command \! clear to clear screen it didn't work with pgcli as it works in psql

$ pgcli
Server: PostgreSQL 12.4 (Ubuntu 12.4-0ubuntu0.20.04.1)
Version: 2.2.0
Chat: https://gitter.im/dbcli/pgcli
Home: http://pgcli.com
pere@(none):pere> \! clear
syntax error at or near "\"
LINE 1: \! clear
        ^

Time: 0.002s
pere@(none):pere>

Your environment

$ python3 --version Python 3.8.5

- [x] Please provide your CLI version.

$ pgcli -v Version: 2.2.0

- [x] What is the output of ``pip freeze`` command.

$ pip3 freeze apturl==0.5.2 bcrypt==3.1.7 blinker==1.4 Brlapi==0.7.0 certifi==2019.11.28 chardet==3.0.4 Click==7.0 colorama==0.4.3 command-not-found==0.3 configobj==5.0.6 cryptography==2.8 cupshelpers==1.0 dbus-python==1.2.16 defer==1.0.6 distro==1.4.0 distro-info===0.23ubuntu1 duplicity==0.8.12.0 entrypoints==0.3 fasteners==0.14.1 future==0.18.2 httplib2==0.14.0 humanize==1.0.0 idna==2.8 keyring==18.0.1 language-selector==0.1 launchpadlib==1.10.13 lazr.restfulclient==0.14.2 lazr.uri==1.0.3 lockfile==0.12.2 louis==3.12.0 macaroonbakery==1.3.1 Mako==1.1.0 MarkupSafe==1.1.0 monotonic==1.5 netifaces==0.10.4 oauthlib==3.1.0 olefile==0.46 paramiko==2.6.0 pexpect==4.6.0 pgspecial==1.9.0 Pillow==7.0.0 prompt-toolkit==3.0.8 protobuf==3.6.1 psycopg2==2.8.4 pycairo==1.16.2 pycups==1.9.73 Pygments==2.7.2 PyGObject==3.36.0 PyJWT==1.7.1 pymacaroons==0.13.0 PyNaCl==1.3.0 pyRFC3339==1.1 python-apt==2.0.0+ubuntu0.20.4.1 python-dateutil==2.7.3 python-debian===0.1.36ubuntu1 pytz==2019.3 pyxdg==0.26 PyYAML==5.3.1 reportlab==3.5.34 requests==2.22.0 requests-unixsocket==0.2.0 screen-resolution-extra==0.0.0 SecretStorage==2.3.1 setproctitle==1.1.10 simplejson==3.16.0 six==1.14.0 sqlparse==0.3.1 systemd-python==234 tabulate==0.8.6 terminaltables==3.1.0 ubuntu-advantage-tools==20.3 ubuntu-drivers-common==0.0.0 ufw==0.36 unattended-upgrades==0.1 urllib3==1.25.8 usb-creator==0.3.7 wadllib==1.3.3 wcwidth==0.2.5 xkit==0.0.0

j-bennet commented 3 years ago

Same answer is here: https://github.com/dbcli/pgcli/issues/1191#issuecomment-663907983 it's not one of the commands pgcli supports. PRs are always welcome.

gfrlv commented 3 years ago

This command is part of pgspecial (one of the dependencies) and works since version pgspecial==1.11.5. Your versions of pgcli and all the dependencies are very old, you need to upgrade pgcli with pip3 install --upgrade pgcli.