From: Ed Avis <eda@waniasset.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #11986: psql uses pager inside Emacs shell buffer (not a terminal)
Date: Mon, 8 Dec 2014 11:39:12 +0000 (UTC)
Message-ID: <loom.20141208T123007-701@post.gmane.org> (raw)
References: <20141117093434.2479.18410@wrigleys.postgresql.org>
<20141203004050.GA25084@momjian.us>
<26947.1417573493@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Tom Lane <tgl <at> sss.pgh.pa.us> writes:
>A quick check here shows a couple of different possibilities in the
>environment seen in a shell buffer:
>
>EMACS=t
>INSIDE_EMACS=23.1.1,comint
Apparently EMACS=t is deprecated and INSIDE_EMACS is the one to use.
However, Emacs being Emacs, it has more than one way to run interactive
subprocesses. This bug report was about 'shell' mode, where a text editing
buffer provides a simple dumb terminal without cursor movement escape
sequences (and sets TERM=dumb). But there is also 'term', providing a
reasonably good terminal emulator inside Emacs. Inside that, a pager does
work (even sophisticated ones such as 'less') and it makes sense to use a
pager since you don't have a scrollable text buffer with all output, but
just a fixed-size terminal window.
'term' mode sets the environment variables to something like
TERM=eterm-color
INSIDE_EMACS=24.4.1,term:0.96
So if INSIDE_EMACS is to be used (rather than checking for TERM=dumb) then
perhaps it should look for the 'comint' string.
I appreciate the concern that this could open a Pandora's box of special
case checks for all sorts of terminal types, but this is only the psql
interactive shell we are talking about here, not the core database code.
And all that is being controlled is the relatively minor choice of whether
to run a pager program, not anything that affects database operations.
psql already contains lots of features which exist to make interactive use
more comfortable even at the expense of some complexity.
Let me see if I can make psql check INSIDE_EMACS on startup to see if it
is running inside 'comint' and if so turn off the pager (by default).
--
Ed Avis <eda@waniasset.com>
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: eda@waniasset.com
Subject: Re: BUG #11986: psql uses pager inside Emacs shell buffer (not a terminal)
In-Reply-To: <loom.20141208T123007-701@post.gmane.org>
References: <20141117093434.2479.18410@wrigleys.postgresql.org> <20141203004050.GA25084@momjian.us> <26947.1417573493@sss.pgh.pa.us> <loom.20141208T123007-701@post.gmane.org>
* 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