Re: BUG #2565: pg tool doesn't detect window size changes

From: PF <kernel(at)pkts(dot)ca>
To: tomas(at)tuxteam(dot)de
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2565: pg tool doesn't detect window size changes
Date: 2006-08-09 17:11:42
Message-ID: 1155143502.18670.27.camel@kirk.clients.pkts.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Wed, 2006-08-09 at 05:31 +0000, tomas(at)tuxteam(dot)de wrote:
> On Mon, Aug 07, 2006 at 09:40:59PM +0000, PFudd wrote:
> >
> > The following bug has been logged online:
> >
> > Bug reference: 2565
> > Logged by: PFudd
> > Email address: kernel(at)pkts(dot)ca
> > PostgreSQL version: 8.1.4
> > Operating system: Fedora Core 5
> > Description: pg tool doesn't detect window size changes
> > Details:
>
> [...]
>
> Sorry for my ignorance, but... what is this "pg tool"? (on my system
> there is a pg command, but it is the pager and has'nt anything to do
> with PostgreSQL).

Sorry, I had created an expect script for psql called pg, and forgot I
had done it. Just didn't want to deal with the command line arguments
and the password prompt.

After unsetting the PAGER environment variable (which was 'less') and
not using the expect script, everything works properly. The window size
changes were not being forwarded by expect, and 'more' did a perfect job
with long lines, whereas 'less' did not.

Upon further investigation (as I couldn't believe less would suck at
this) it turns out that the 'r' option in my 'LESS' environment variable
was causing the line wrap breakage (r = show raw escape sequences).

Ok, I've found these solutions: stop using 'expect' and remove the 'r'
from the LESS environment variable.

Next question: can anyone tell me how to automate password logins with
psql?

Thanks!

The old expect script (doesn't pass window change signals):
------
#!/usr/bin/expect -f
set timeout 2
spawn psql -h localhost -U admin -W processdb
match_max 100000
expect -exact "Password for user admin: "
send -- "some password here\r"
expect {
"protein=#" {;}
"FATAL:" {puts "Failure1.";exit 2;}
default {puts "Failure2.";exit 2;}
}
interact
--
PF <kernel(at)pkts(dot)ca>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2006-08-09 17:58:58 Re: BUG #2569: statement_timeout bug on Windows
Previous Message PF 2006-08-09 16:51:48 Re: [BUGS] BUG #2560: Web page documentation hard to use