« Return to Thread: [scala-tools] sbt emacs mode

Re: [scala-tools] sbt emacs mode

by Mark Harrah :: Rate this Message:

Reply to Author | View in Thread

On Sunday 09 August 2009, L Jantzen wrote:

> Grey wrote:
> > Should have sent to scala-tools initially.  Sorry for double post.
> >
> > The following is a small emacs elisp script to run sbt as an inferior
> > mode process from emacs.  It uses emacs' compile.el to identify error
> > messages and then jump to errors in scala source files.
>
> Sorry for awakening this old thread, but I have a question.  Its probably
> more emacs-related than anything else, but I have a problem with
> ansi-control chars when entering sbt-shell mode:
>
> -*- mode: compilation; default-directory: "~/dev/scala/myproject/" -*-
> Comint started at Sun Aug  9 21:56:56
>
> cd /home/leif/dev/scala/myproject; sbt
> [info] Building project myproject 1.0 using
> sbt.DefaultProject
> [info]    with sbt 0.4.6 and Scala 2.7.4
> [info] No actions specified, interactive session started.
> Execute 'help' for more information.
>
>
> How do I get rid of the ansi control characters, or how do I get the
> sbt-shell to interpret them correctly?
>
> I have added the following to my .emacs: (snagged from
> http://www.grokblok.com/2007/12/13/emacs-shell-ansi-colors.html)
>
> (autoload 'ansi-color-for-comint-mode-on "ansi-color" nil t)
> (add-hook 'shell-mode-hook 'ansi-color-for-comint-mode-on)
>
> I have also tried to create a ~/.emacs_bash with the following two lines:
>
> alias ls=ls
> unset LS_COLORS
>
> Any pointers?

From the sbt side of things, you can disable the control characters by adding
the option:

  -Dsbt.log.noformat=true

to your sbt startup script.

Thanks,
Mark

 « Return to Thread: [scala-tools] sbt emacs mode