Re: psql: Buggy interactions with wraparound in maximized gnome terminals.

From: Tomas Zubiri <me(at)tomaszubiri(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: chet(dot)ramey(at)case(dot)edu, bug-readline(at)gnu(dot)org, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: psql: Buggy interactions with wraparound in maximized gnome terminals.
Date: 2019-12-21 22:37:20
Message-ID: CAE3VKEpPnhTh2x2fhkQTjR2vdq49SbSFV11tMnmczngu8PHp=g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

>(I don't think the OP specified which readline and/or Postgres version
he was using.)
That would be postgres 12.1 and readline 7

Tomas Zubiri
Software Developer
Cel: +54 911 5891 8239

El sáb., 21 de dic. de 2019 a la(s) 18:41, Tom Lane
(tgl(at)sss(dot)pgh(dot)pa(dot)us) escribió:
>
> Chet Ramey <chet(dot)ramey(at)case(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-12-21 22:41:52 Re: BUG #16161: pg_ctl stop fails sometimes (on Windows)
Previous Message Tom Lane 2019-12-21 21:40:29 Re: psql: Buggy interactions with wraparound in maximized gnome terminals.