From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: henry atting Newsgroups: gmane.emacs.help Subject: Re: how to display that a term is inside emacs Date: Thu, 05 Dec 2013 11:38:09 +0100 Organization: LiteraturLateNight Message-ID: <87pppbshv2.fsf@bye.fritz.box> References: <87pppcef7j.fsf@bye.fritz.box> <87haao1ltu.fsf@kuiper.lan.informatimago.com> <87r49sfifp.fsf@bye.fritz.box> <8738m8l4gt.fsf@nl106-137-194.student.uu.se> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1386240021 6063 80.91.229.3 (5 Dec 2013 10:40:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Dec 2013 10:40:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 05 11:40:28 2013 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 1VoWM5-0003jm-G1 for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Dec 2013 11:40:25 +0100 Original-Received: from localhost ([::1]:52779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VoWM5-0007Yy-2b for geh-help-gnu-emacs@m.gmane.org; Thu, 05 Dec 2013 05:40:25 -0500 Original-Path: usenet.stanford.edu!ihnp4.UCSD.Edu!newsfeed.news.ucla.edu!news.snarked.org!feeder.erje.net!us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!news.unit0.net!news.uni-stuttgart.de!rz.uni-karlsruhe.de!feed.news.schlund.de!schlund.de!news.online.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 43 Original-NNTP-Posting-Host: port-92-195-37-142.dynamic.qsc.de Original-X-Trace: online.de 1386239908 22798 92.195.37.142 (5 Dec 2013 10:38:28 GMT) Original-X-Complaints-To: abuse@einsundeins.com Original-NNTP-Posting-Date: Thu, 5 Dec 2013 10:38:28 +0000 (UTC) User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:rljzWgXUOuEk3Frt0qItRs8Zjm8= Original-Xref: usenet.stanford.edu gnu.emacs.help:202573 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:94842 Archived-At: Emanuel Berg writes: > henry atting writes: > >>> TERM is probably different in the two terminal >>> emulators. >>> >>> in M-x shell, TERM=emacs >>> in M-x term, TERM=eterm-color >>> I don't have M-x multi-term >>> in xterm, TERM=xterm-256color >>> I don't have rxvt-unicode. >>> >>> so you could have: >>> >>> export PS1="${TERM} ${PS1}" >>> >>> in your ~/.bashrc etc. >> >> Ah, I see, this changes the bash prompt in urxvt, not >> in emacs. I did not think of doing it this way but >> it's fine by me. Then again I use zsh, not bash >> (what I unfortunately kept a secret) - it's a little >> more complicated but doable anyway. > > I think Emacs reads PS1 as well. Check out my post. It > is not more complicated in zsh and it is the exact same > principle. As far as I can see urxvt (which is called `rx' on my system) reads PS1 and Emacs reads TERM, so I found out this (or the like) is the easiest way to do it in ~/.zshrc: case $TERM in rx*) precmd () PS1="%d"' in rx ' ;; esac Thanks, henry