Fix PSQL Console plugin for OS X

From: Nicola Vitacolonna <nvitacolonna(at)gmail(dot)com>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: Fix PSQL Console plugin for OS X
Date: 2016-03-18 21:44:59
Message-ID: 75CDF5B1-6EC5-4553-B8DF-7A28D00FA9C8@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

The PSQL Console command has been broken for a long time on OS X. Could you please fix it?

This is how the command should look like:

Command=/usr/bin/osascript -e 'ignoring application responses' -e 'tell application "Terminal"' -e 'activate' -e 'do script ""' -e 'do script "\'$$PGBINDIR/psql\' --host \'$$HOSTNAME\' --port $$PORT --username \'$$USERNAME\' \'$$DATABASE\' && exit || sleep 5 && exit" in window 1' -e 'end tell' -e 'end ignoring'

For humans:

ignoring application responses
tell application "Terminal"
do script "" -- open a new Terminal window
do script "$$PGBINDIR/psql --host '$$HOSTNAME' --port $$PORT --username '$$USERNAME' '$$DATABASE' && exit || sleep 5 && exit" in window 1
activate
end tell
end ignoring

The changes are as follows:

1) add `do script “”` to open a new Terminal window. This is necessary because in the current window there may be a running process.
2) Remove `with command` (not wrong, but redundant).
3) Add `in window 1`. This is essential, otherwise the command fails.
4) Move `activate` at the end. This change is not strictly necessary, it is just a matter personal preference.

Thanks,
Nicola

PS: Is there a way to contribute to the code directly (à la Github)?

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Surinder Kumar 2016-03-21 05:01:02 Re: [PATCH] Enhancement in sql-field control [pgAdmin4]
Previous Message Thom Brown 2016-03-18 17:42:00 Speed up node animation in pgAdmin4