From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Margolin Newsgroups: gmane.emacs.help Subject: Re: Examining the output of a shell command? Date: Sun, 28 Jun 2015 21:39:09 -0400 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1435542018 21197 80.91.229.3 (29 Jun 2015 01:40:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 29 Jun 2015 01:40:18 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Jun 29 03:40:18 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z9O3W-0007V4-46 for geh-help-gnu-emacs@m.gmane.org; Mon, 29 Jun 2015 03:40:18 +0200 Original-Received: from localhost ([::1]:40305 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z9O3V-00050Z-5k for geh-help-gnu-emacs@m.gmane.org; Sun, 28 Jun 2015 21:40:17 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!barmar.motzarella.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Injection-Info: barmar.motzarella.org; posting-host="2be9e9f5dd9af768b8861af71b85fc28"; logging-data="25835"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19OBonMIUAJDt5WYc4JsA7p" User-Agent: MT-NewsWatcher/3.5.3b3 (Intel Mac OS X) Cancel-Lock: sha1:QCmSF4QCXfcesIPb/h6WqjAzZOk= Original-Xref: usenet.stanford.edu gnu.emacs.help:212985 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:105271 Archived-At: In article , Dan Espen wrote: > Michael Heerdegen writes: > > > Dan Espen writes: > > > >> Maybe the OP doesn't realize that some programs that output > >> escape sequences won't do so when run as an Emacs shell command. > >> > >> /bin/ls being a good example. > >> > >> In that case, run: > >> > >> /bin/ls --color > >> > >> as an Emacs shell command. > > > > I guess programs like "ls" check the TERM environment variable. > > > > Try: > > > > (setenv "TERM" "xterm") > > I doubt $TERM is the key. > /bin/ls knows when it is interactive. What they often check is whether stdout is connected to a terminal. > > (shell-command-to-string "ls --color") > > This will show escape sequences regardless of $TERM. > It did for me with the Emacs default value "dumb". -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me ***