Re: Fix PSQL Console plugin for OS X

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Nicola Vitacolonna <nvitacolonna(at)gmail(dot)com>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: Fix PSQL Console plugin for OS X
Date: 2016-03-21 14:33:27
Message-ID: CA+OCxoxkv4o__oWvMAvzVK=72c3BTcB1ep_vr3tMp9M7GBFb1A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

On Fri, Mar 18, 2016 at 9:44 PM, Nicola Vitacolonna
<nvitacolonna(at)gmail(dot)com> wrote:
> 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.

I'm not sure why you need this. I don't - I always get a new window
when using the plugin.

> 2) Remove `with command` (not wrong, but redundant).
> 3) Add `in window 1`. This is essential, otherwise the command fails.

Similarly, that's never been an issue for me.

> 4) Move `activate` at the end. This change is not strictly necessary, it is just a matter personal preference.
>
> PS: Is there a way to contribute to the code directly (à la Github)?

Please send patches (created with 'git diff') against the repo at
http://git.postgresql.org/gitweb/?p=pgadmin3.git;a=summary. We don't
use Github.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Ashesh Vashi 2016-03-21 17:15:35 pgAdmin 4 commit: Speed up the expansion/collapsing of nodes.
Previous Message Murtuza Zabuawala 2016-03-21 10:55:11 Suggestion on "External types" sql query in pgAdmin3