pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: chet.ramey@case.edu
Cc: Tomas Zubiri <me@tomaszubiri.com>
Cc: bug-readline@gnu.org
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: psql: Buggy interactions with wraparound in maximized gnome terminals.
Date: Sat, 21 Dec 2019 16:40:29 -0500
Message-ID: <26175.1576964429@sss.pgh.pa.us> (raw)
In-Reply-To: <ad87818d-d05b-e8c8-224d-587011e2ac29@case.edu>
References: <CAE3VKEr2LZYbogZOkpAqVOq=rPnPfC+_M9XBVGp_ci3rtgqqQA@mail.gmail.com>
	<10264.1576876915@sss.pgh.pa.us>
	<CAE3VKEqv62MQMafcu31J73e65UhziaG9UJNyH-FJzeHCBXzgTA@mail.gmail.com>
	<ad87818d-d05b-e8c8-224d-587011e2ac29@case.edu>

Chet Ramey <chet.ramey@case.edu> writes:
> On 12/20/19 4:48 PM, Tomas Zubiri wrote:
>> This is probably hard to reproduce, but I entered a state where the
>> command I was writing was wrapping around at the 81st character while
>> in full screen,  and the 1st character was being overwritten.This did
>> not affect the command sent to the server, but I would not have a way
>> to see what command I just entered.

> It seems like the readline SIGWINCH handler, which causes it to update its
> idea of the screen dimensions, isn't being called. I can't reproduce this
> using readline and bash, and I don't know what postgres does with its
> signal handling, or how it configures readline's signal handling (I assume
> it doesn't do anything special).

We don't touch SIGWINCH at all, so if readline sets up a handler for that,
it ought to behave as expected.

I notice though that we do this just before each readline() call:

        /*
         * Some versions of readline don't notice SIGWINCH signals that arrive
         * when not actively reading input.  The simplest fix is to always
         * re-read the terminal size.  This leaves a window for SIGWINCH to be
         * missed between here and where readline() enables libreadline's
         * signal handler, but that's probably short enough to be ignored.
         */
#ifdef HAVE_RL_RESET_SCREEN_SIZE
        rl_reset_screen_size();
#endif

Is it conceivable that that bollixes things somehow, on some builds?
(I don't think the OP specified which readline and/or Postgres version
he was using.)

			regards, tom lane





view thread (6+ messages)  latest in thread

Message-ID: <26175.1576964429@sss.pgh.pa.us>
Permalink:  ../26175.1576964429@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/26175.1576964429@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, chet.ramey@case.edu, me@tomaszubiri.com, bug-readline@gnu.org
  Subject: Re: psql: Buggy interactions with wraparound in maximized gnome terminals.
  In-Reply-To: <26175.1576964429@sss.pgh.pa.us>
  References: <CAE3VKEr2LZYbogZOkpAqVOq=rPnPfC+_M9XBVGp_ci3rtgqqQA@mail.gmail.com> <10264.1576876915@sss.pgh.pa.us> <CAE3VKEqv62MQMafcu31J73e65UhziaG9UJNyH-FJzeHCBXzgTA@mail.gmail.com> <ad87818d-d05b-e8c8-224d-587011e2ac29@case.edu> <26175.1576964429@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox