Re: BUG #11986: psql uses pager inside Emacs shell buffer (not a terminal)

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Ed Avis <eda(at)waniasset(dot)com>
Cc: 'Francisco Olarte' <folarte(at)peoplecall(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #11986: psql uses pager inside Emacs shell buffer (not a terminal)
Date: 2014-12-10 18:45:48
Message-ID: 20141210184548.GY1768@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Ed Avis wrote:
> psql decides whether to run a pager depending on whether its output is a tty.
> That is the 'guessing' I referred to.
>
> If starting from scratch I would probably prefer pager=off to be the default, but that
> is a larger change and would certainly inconvenience those who currently use psql in xterm, etc.

This "guessing" is well established. Git uses a pager automatically
when its output is a tty, for example, and doesn't use one when it's
being piped or redirected. Telling git users that they must turn the
pager off before redirecting would put off a lot of people, regardless
of the "but you configured it so!" argument.

I don't like software that does magic things when they don't make sense,
but I do like software that does magic things when they are demonstrably
useful -- particularly if I can turn them off in the very rare corner
cases where I need to do that.

I'm not an Emacs user, but years ago if I invoked "man" from inside Vim
the pager was invoked and it had the stupid property of telling me that
my terminal was dysfunctional (what!? it's a freaking xterm, FFS) and
displaying useless, horrid prompts that I couldn't get rid of. I truly
appreciate that now the pager, for some reason, now works correctly
inside a Vim window. Not sure who fixed it but they have my sincerest
appreciation.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2014-12-10 19:33:14 Re: regression, deadlock in high frequency single-row UPDATE
Previous Message rmoyers 2014-12-10 18:11:46 BUG #12188: Output of XML Is Truncated