Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XyBQD-0005hm-4L for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Dec 2014 03:25:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XyBQC-00078p-Iu for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Dec 2014 03:25:08 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Xxwfl-0005SX-Mz for pgsql-bugs@postgresql.org; Mon, 08 Dec 2014 11:40:13 +0000 Received: from plane.gmane.org ([80.91.229.3]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Xxwfg-0003oX-IL for pgsql-bugs@postgresql.org; Mon, 08 Dec 2014 11:40:11 +0000 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xxwfc-0005I5-5v for pgsql-bugs@postgresql.org; Mon, 08 Dec 2014 12:40:04 +0100 Received: from 80.169.169.174 ([80.169.169.174]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Dec 2014 12:40:04 +0100 Received: from eda by 80.169.169.174 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 08 Dec 2014 12:40:04 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: pgsql-bugs@postgresql.org From: Ed Avis Subject: Re: BUG #11986: psql uses pager inside Emacs shell buffer (not a terminal) Date: Mon, 8 Dec 2014 11:39:12 +0000 (UTC) Lines: 40 Message-ID: References: <20141117093434.2479.18410@wrigleys.postgresql.org> <20141203004050.GA25084@momjian.us> <26947.1417573493@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 80.169.169.174 (Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:34.0) Gecko/20100101 Firefox/34.0 Cyberfox/34.0) X-Pg-Spam-Score: 0.6 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Tom Lane 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs