public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] emacs shell color question
@ 2006-12-24 18:00 David Relson
  2006-12-25  7:00 ` [gentoo-user] " reader
  0 siblings, 1 reply; 11+ messages in thread
From: David Relson @ 2006-12-24 18:00 UTC (permalink / raw
  To: gentoo-user

G'day,

I habitually run emacs shell sessions.  When I forget the --color
options, for example for the ls and emerge commands, the shell session
displays the ascii escape sequences which is pretty ugly. Is there an
option for telling emacs to handle escape sequences?

Thanks.

David
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-user]  Re: emacs shell color question
  2006-12-24 18:00 [gentoo-user] emacs shell color question David Relson
@ 2006-12-25  7:00 ` reader
  2006-12-25 13:30   ` David Relson
  0 siblings, 1 reply; 11+ messages in thread
From: reader @ 2006-12-25  7:00 UTC (permalink / raw
  To: gentoo-user

David Relson <relson@osagesoftware.com> writes:

> G'day,
>
> I habitually run emacs shell sessions.  When I forget the --color
> options, for example for the ls and emerge commands, the shell session
> displays the ascii escape sequences which is pretty ugly. Is there an
> option for telling emacs to handle escape sequences?

Does the problem persist if you use `eshell' instead of shell?
(M-x eshell <RET>)

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user]  Re: emacs shell color question
  2006-12-25  7:00 ` [gentoo-user] " reader
@ 2006-12-25 13:30   ` David Relson
  2006-12-26  3:54     ` reader
  0 siblings, 1 reply; 11+ messages in thread
From: David Relson @ 2006-12-25 13:30 UTC (permalink / raw
  To: gentoo-user

On Mon, 25 Dec 2006 01:00:31 -0600
reader@newsguy.com wrote:

> David Relson <relson@osagesoftware.com> writes:
> 
> > G'day,
> >
> > I habitually run emacs shell sessions.  When I forget the --color
> > options, for example for the ls and emerge commands, the shell
> > session displays the ascii escape sequences which is pretty ugly.
> > Is there an option for telling emacs to handle escape sequences?
> 
> Does the problem persist if you use `eshell' instead of shell?
> (M-x eshell <RET>)

yes.

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-user]  Re: emacs shell color question
  2006-12-25 13:30   ` David Relson
@ 2006-12-26  3:54     ` reader
  2006-12-26 12:35       ` David Relson
  0 siblings, 1 reply; 11+ messages in thread
From: reader @ 2006-12-26  3:54 UTC (permalink / raw
  To: gentoo-user

David Relson <relson@osagesoftware.com> writes:

> On Mon, 25 Dec 2006 01:00:31 -0600
> reader@newsguy.com wrote:
>
>> David Relson <relson@osagesoftware.com> writes:
>> 
>> > G'day,
>> >
>> > I habitually run emacs shell sessions.  When I forget the --color
>> > options, for example for the ls and emerge commands, the shell
>> > session displays the ascii escape sequences which is pretty ugly.
>> > Is there an option for telling emacs to handle escape sequences?
>> 
>> Does the problem persist if you use `eshell' instead of shell?
>> (M-x eshell <RET>)

There is an ansi mode that is made to hand escape sequences but that
should not be necessary.  All recent emacs just work.

That makes me think it is something in your environment.

To get expert help I suggest you post on gnu.emacs.help  Or on
gmane.emacs.help (same list).

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user]  Re: emacs shell color question
  2006-12-26  3:54     ` reader
@ 2006-12-26 12:35       ` David Relson
  2006-12-26 15:51         ` reader
  0 siblings, 1 reply; 11+ messages in thread
From: David Relson @ 2006-12-26 12:35 UTC (permalink / raw
  To: gentoo-user; +Cc: reader

On Mon, 25 Dec 2006 21:54:01 -0600
reader@newsguy.com wrote:

> David Relson <relson@osagesoftware.com> writes:
> 
> > On Mon, 25 Dec 2006 01:00:31 -0600
> > reader@newsguy.com wrote:
> >
> >> David Relson <relson@osagesoftware.com> writes:
> >> 
> >> > G'day,
> >> >
> >> > I habitually run emacs shell sessions.  When I forget the --color
> >> > options, for example for the ls and emerge commands, the shell
> >> > session displays the ascii escape sequences which is pretty ugly.
> >> > Is there an option for telling emacs to handle escape sequences?
> >> 
> >> Does the problem persist if you use `eshell' instead of shell?
> >> (M-x eshell <RET>)
> 
> There is an ansi mode that is made to hand escape sequences but that
> should not be necessary.  All recent emacs just work.
> 
> That makes me think it is something in your environment.
> 
> To get expert help I suggest you post on gnu.emacs.help  Or on
> gmane.emacs.help (same list).

Eureka!  

A search for "ansi" at gmane suggested using ansi-term instead
of shell.  That gave me color but previous line editing and such were
different, which I'm not sure I like :-<

So I looked in /usr/share/emacs/... for ansi-term and found
ansi-color.el.  Comments at the beginning tell how to turn on color
within a shell.  This looks like what I want!

Thank you muchly.

David
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-user]  Re: emacs shell color question
  2006-12-26 12:35       ` David Relson
@ 2006-12-26 15:51         ` reader
  2006-12-27  0:24           ` David Relson
  0 siblings, 1 reply; 11+ messages in thread
From: reader @ 2006-12-26 15:51 UTC (permalink / raw
  To: gentoo-user

David Relson <relson@osagesoftware.com> writes:

> A search for "ansi" at gmane suggested using ansi-term instead
> of shell.  That gave me color but previous line editing and such were
> different, which I'm not sure I like :-<
>
> So I looked in /usr/share/emacs/... for ansi-term and found
> ansi-color.el.  Comments at the beginning tell how to turn on color
> within a shell.  This looks like what I want!

Good, however you should not really need to use ansi-mode.
I do not, and don't have the trouble you mentioned.

In normal shell-mode (M-x shell) I do see the escape sequences you
mention but not in eshell (M-x eshell).

I think, if you post on gmane.emacs.help with what you are
experiencing someone will be able to help you identify, what in your
OS setup is causing the problem.

I did notice one thread where the user ended up discovering somekind
of alias to ls that was causing his problem.

 http://thread.gmane.org/gmane.emacs.help/39496/focus=39505

Typing `alias' in an xterm might reveal something.  Here I see:
      alias ls='ls --color=auto'
as the only reference to ls.

Posting there with your exact problem would probably be best.

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user]  Re: emacs shell color question
  2006-12-26 15:51         ` reader
@ 2006-12-27  0:24           ` David Relson
  2006-12-27 14:00             ` Tom Naujokas
  0 siblings, 1 reply; 11+ messages in thread
From: David Relson @ 2006-12-27  0:24 UTC (permalink / raw
  To: gentoo-user; +Cc: reader

On Tue, 26 Dec 2006 09:51:22 -0600
reader@newsguy.com wrote:

...[snip]...
> 
> Good, however you should not really need to use ansi-mode.
> I do not, and don't have the trouble you mentioned.
> 
> In normal shell-mode (M-x shell) I do see the escape sequences you
> mention but not in eshell (M-x eshell).
> 
> I think, if you post on gmane.emacs.help with what you are
> experiencing someone will be able to help you identify, what in your
> OS setup is causing the problem.
> 
> I did notice one thread where the user ended up discovering somekind
> of alias to ls that was causing his problem.
> 
>  http://thread.gmane.org/gmane.emacs.help/39496/focus=39505
> 
> Typing `alias' in an xterm might reveal something.  Here I see:
>       alias ls='ls --color=auto'
> as the only reference to ls.
> 
> Posting there with your exact problem would probably be best.

I generally have ls aliased to 'ls --color=none' and that works
fine.  In my post I used ls as a simple example of a program
that can/does use escape sequences.  

Other programs that use escape sequences are emerge and runscript
(used in starting services).  Alias 'emerge --color'
suppresses ansi color sequences for direct invocations of emerge
(because the alias is used for that).  

I also use 'eix-sync' which runs emerge.  In _this_ instance, ansi
escape sequences are _not_ suppressed and I do find them annoying.

Now that I'm home from work, I have the time to experiment :->
-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user]  Re: emacs shell color question
  2006-12-27  0:24           ` David Relson
@ 2006-12-27 14:00             ` Tom Naujokas
  2006-12-27 18:51               ` reader
  0 siblings, 1 reply; 11+ messages in thread
From: Tom Naujokas @ 2006-12-27 14:00 UTC (permalink / raw
  To: gentoo-user

On Tue, 2006-26-12 at 19:24 -0500:

...[snip]...
> > 
> > Good, however you should not really need to use ansi-mode.
> > I do not, and don't have the trouble you mentioned.
> > 
> > In normal shell-mode (M-x shell) I do see the escape sequences you
> > mention but not in eshell (M-x eshell).
> > 
...[snip]...

I have similar problems with xemacs. Both shell and eshell act the same
and there seems to be no ansi-term for xemacs. This used to work fine.

Could this be a terminfo problem? When I do the following in a xemacs
shell:

tnaujoka@Athlon-XP-2500 ~ $ echo $TERM
emacs
tnaujoka@Athlon-XP-2500 ~ $ find /usr/share/terminfo -name emacs -print
tnaujoka@Athlon-XP-2500 ~ $ 

Doesn't this indicate that the terminal type "emacs" is missing from the
terminfo database. If so, how would I get it back?

Tom

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-user]  Re: emacs shell color question
  2006-12-27 14:00             ` Tom Naujokas
@ 2006-12-27 18:51               ` reader
  2006-12-27 20:51                 ` Tom Naujokas
  0 siblings, 1 reply; 11+ messages in thread
From: reader @ 2006-12-27 18:51 UTC (permalink / raw
  To: gentoo-user

Tom Naujokas <tomnaujokas@gmail.com> writes:

> On Tue, 2006-26-12 at 19:24 -0500:
>
> ...[snip]...
>> > 
>> > Good, however you should not really need to use ansi-mode.
>> > I do not, and don't have the trouble you mentioned.
>> > 
>> > In normal shell-mode (M-x shell) I do see the escape sequences you
>> > mention but not in eshell (M-x eshell).
>> > 
> ...[snip]...
>
> I have similar problems with xemacs. Both shell and eshell act the same
> and there seems to be no ansi-term for xemacs. This used to work fine.

Are you using [Xe]macs in console mode or in an xterm .. other?

What is the output of `alias|grep ls'?

> Could this be a terminfo problem? When I do the following in a xemacs
> shell:

Not likely

> tnaujoka@Athlon-XP-2500 ~ $ echo $TERM
> emacs
> tnaujoka@Athlon-XP-2500 ~ $ find /usr/share/terminfo -name emacs -print
> tnaujoka@Athlon-XP-2500 ~ $ 
>
> Doesn't this indicate that the terminal type "emacs" is missing from the
> terminfo database. If so, how would I get it back?

No.  Emacs terminal is internal to [Xe]macs

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [gentoo-user]  Re: emacs shell color question
  2006-12-27 18:51               ` reader
@ 2006-12-27 20:51                 ` Tom Naujokas
  2006-12-28  3:09                   ` reader
  0 siblings, 1 reply; 11+ messages in thread
From: Tom Naujokas @ 2006-12-27 20:51 UTC (permalink / raw
  To: gentoo-user

On Wed, 2006-27-12 at 12:51 -0600, reader@newsguy.com wrote:
> ...[snip]...
> 
> Are you using [Xe]macs in console mode or in an xterm .. other?

I'm starting xemacs from an xterm with the command "xemacs &". 

> What is the output of `alias|grep ls'?

$ alias|grep ls
alias d='ls --color'
alias ll='ls --color -l'
alias ls='ls --color=auto'
$ 

I've never customized those aliases.

> 
> No.  Emacs terminal is internal to [Xe]macs
> 

But still, wouldn't commands like ls or gcc need the terminfo in
order to know the correct escape sequences to generate for that
internal terminal?

Tom Naujokas

-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

* [gentoo-user]  Re: emacs shell color question
  2006-12-27 20:51                 ` Tom Naujokas
@ 2006-12-28  3:09                   ` reader
  0 siblings, 0 replies; 11+ messages in thread
From: reader @ 2006-12-28  3:09 UTC (permalink / raw
  To: gentoo-user

Tom Naujokas <tomnaujokas@gmail.com> writes:

> On Wed, 2006-27-12 at 12:51 -0600, reader@newsguy.com wrote:
>> ...[snip]...
>> 
>> Are you using [Xe]macs in console mode or in an xterm .. other?
>
> I'm starting xemacs from an xterm with the command "xemacs &". 
>
>> What is the output of `alias|grep ls'?
>
> $ alias|grep ls
> alias d='ls --color'
> alias ll='ls --color -l'
> alias ls='ls --color=auto'


> But still, wouldn't commands like ls or gcc need the terminfo in
> order to know the correct escape sequences to generate for that
> internal terminal?

I am not an expert and not an Xemacs user... I use fsf emacs since
1996.  

However my terminfo has no entry for emacs either and I do not
see the escape sequences so I think the answer to above question is
no.

You might have a lisp package called ansi-colors.el in your Xemacs
installation.  Run this command against the directory that holds all
the Xemacs source lisp files (ending in *.el *.elc)

   find YourLispDirectory/ -iname '*ansi*'

And see if it is available.  If so I think it will do what you need
for now.  But I do beleive something in your env is causing the
trouble.

  For expert advice on this I suggest you post a question on:
  gnu.emacs.xemacs  newsgroup.

You can get to that newsgroup on www.gmane.org to.  Its called:
 gmane.emacs.xemacs.general

Someone there will be able to give you expert advice.



-- 
gentoo-user@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2006-12-28  3:15 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-24 18:00 [gentoo-user] emacs shell color question David Relson
2006-12-25  7:00 ` [gentoo-user] " reader
2006-12-25 13:30   ` David Relson
2006-12-26  3:54     ` reader
2006-12-26 12:35       ` David Relson
2006-12-26 15:51         ` reader
2006-12-27  0:24           ` David Relson
2006-12-27 14:00             ` Tom Naujokas
2006-12-27 18:51               ` reader
2006-12-27 20:51                 ` Tom Naujokas
2006-12-28  3:09                   ` reader

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox