[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What I'm missing when using M-x shell

From: Tim X
Subject: Re: What I'm missing when using M-x shell
Date: Sun, 14 Sep 2008 12:20:44 +1000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Livin Stephen <address@hidden> writes:

> On Sep 12, 9:20 pm, "Francis Moreau" <address@hidden> wrote:
>> Hello,
>> I'm still trying to do all my jobs inside emacs but I'm missing a couple
>> things.
>> The first one is what I can't do anymore when working with a shell/terminal
>> inside emacs.
>>   1/ Most applications based on ncurse behave strangely when using
>>       M-x term
>>   2/ Although M-x shell has history reference completions, it doesn't 
>> complete
>>       for '!#:<n>'. But '!!:<n>' works fine though.
>>   3/ There's no readline "reverse-search-history" function (C-r) which does
>>      an _incremental_  search;
>>   4/ There's no readline "yank-last-arg" function which inserts the last
>>       argument to the previous commands
>>   5/ emacs doesn't expand shell variable when hitting <TAB>
>> Am I missing something ?
>> Thanks
>> --
>> Francis
> Hi, FM.
> I too found M-x term to initially fall terribly short - but not
> anymore :)
> YMMV, but I had to "export TERM=xterm" in my ~/.bashrc  to make M-x
> term work as per expectations...
> - i.e. to be usable for everyday use: on my Mac I'm perfectly happy
> with it's behaviour now!
>  (previous value in M-x term term used to show $TERM to be eterm-color
> or something like that)
> After this change my man-pages, etc don't look like their full of odd
> characters (especiallly when trying to print single-quotes), nor is
> man-page text underlined randomly .
> This TERM change definitely took care of at least issues 3/, and 5/
> which you mention
>  - I have both "C-r" history-search and "TAB"-completion of shell-vars
> AND file-names working.

I think the reason you got better results setting the term to xterm
rather than eterm-color is to do with terminfo. 

There are many programs that when executed check the terminfo database
to find out what the capabilities of the terminal are. Often, a program
will drop back to a 'dumb' terminal setting if the terminal returned by
$TERM is not in the terminfo database. 

IIRC, eterm-color is not set in the terminfo database on most systems,
so when you run a program, it cannot determine what the
capabilities/characteristics of the terminal your running under are. 

Setting the TERM variable to xterm probably gives resonable results
because the capabilities are similar. However, you would probably get
even better results by adding eterm-color to your terminfo database. I
think you will find the relevant information in the Emacs etc/e

I'm surprised setting TERM=xterm and exporting it prior to running M-x
term works at all. The TERM setting is (I think) set as part of the
startup (see term.el). I'm assuming what you are doing is issuing an
export TERM=xterm or something similar once you have started M-x term?

On my system, Debian, I've put the eterm-color terminfo file in
/etc/terminfo/e/ and I don't seem to have many of the problems being
reported under M-x term. For example, if I enter echo $T and hit tab, it
is completed to echo $TERM. 



tcross (at) rapttech dot com dot au

reply via email to

[Prev in Thread] Current Thread [Next in Thread]