[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: how to display that a term is inside emacs
From: |
henry atting |
Subject: |
Re: how to display that a term is inside emacs |
Date: |
Thu, 05 Dec 2013 11:38:09 +0100 |
User-agent: |
Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) |
Emanuel Berg <embe8573@student.uu.se> writes:
> henry atting <snd@online.de> 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
Re: how to display that a term is inside emacs, Emanuel Berg, 2013/12/04