Shell Bash Shell colors

Bug #328950 reported by arky
4
Affects Status Importance Assigned to Milestone
emacs-snapshot (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: emacs-snapshot

The bash shell color output confuses the M-x shell . The M-x ansi-term works fine.

 echo $TERM
dumb

ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 8.10
NonfreeKernelModules: ath_hal
Package: emacs-snapshot-gtk 1:20081013-1
PackageArchitecture: all
ProcEnviron:
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=en_IN
 SHELL=/bin/bash
SourcePackage: emacs-snapshot
Uname: Linux 2.6.27-9-generic i686

Tags: apport-bug
Revision history for this message
arky (arky) wrote :
Revision history for this message
era (era) wrote :

If the problem is only with the ls command, and an "unalias ls" fixes it, it's questionable whether the bug is with Emacs.

Could you please clarify whether this is the case? The bug's status can be reset from "Incomplete" to "New" once we have this information.

Changed in emacs-snapshot:
status: New → Incomplete
Revision history for this message
arky (arky) wrote :

Its more likely that emacs dumb term (M-x term) has a problem with bash color codes. See the screenshots of same commands in ansi-term and emacs normal terminal

Revision history for this message
era (era) wrote :

That's really beside the point. No, those escape codes will not produce colors in a "dumb" terminal, but that's not really a bug. If you want the escape codes to work and ansi-term offers that feature, I don't see why you don't use ansi-term. If my hunch is correct, there may be a bug here, and that is that color support in ls is not turned off when the terminal type is dumb. It's not a bug in Emacs or in Bash proper, but possibly in the Bash startup files shipped with Ubuntu (if indeed this is reproducible with the default .bashrc etc out of the box).

So: does "unalias ls" fix anything for you?

Wishing for support for color escape codes in M-x shell is a valid feature request but not really a bug, and should probably by brought up with the Emacs upstream maintainer.

I hope I have correctly interpreted your report. Please do follow up and confirm or perhaps clarify. Thanks.

Revision history for this message
Romain Francoise (rfrancoise) wrote : Re: [Bug 328950] Re: Shell Bash Shell colors

You just need to enable the ansi color filter for comint with
M-x ansi-color-for-comint-mode-on. To make it persistent, add the
following to your init file:

  (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)

Revision history for this message
arky (arky) wrote :

Yes, the 'unalias ls" fixes it for me. Also thanks to everyone for pitching in to help.

Revision history for this message
era (era) wrote :

In the light of your latest comment, I'm interpreting this as "not really a bug" and marking it as Invalid. If you think there is a bug after all, feel free to reopen, of course. Thanks for your report, and please don't hesitate to report further problems here.

Changed in emacs-snapshot:
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.