[ESS] ANSI escape sequences in ESS

Martin Maechler m@ech|er @end|ng |rom @t@t@m@th@ethz@ch
Tue May 12 08:13:55 CEST 2015


On Tue, May 12, 2015 at 12:40 AM, Vitalie Spinu <spinuvit using gmail.com> wrote:
>
>
> Don't you have TERM=dumb in process-environment list?
>
> What's the value of Sys.getenv("TERM") for you?

Yes, I do have both   TERM=dumb  set... I have some non-default comint
settings.. Probably one of those must help....
...
actually "no":

emacs24 -Q

manually    M-x load-file ...../ess/lisp/ess-site.el
                   M-x R
and it works ...

for me.



>
>  >>> Martin Maechler on Mon, 11 May 2015 23:02:05 +0200 wrote:
>
>  > Interestingly, this *works* extremely nicely for me,  using emacs
>  > 23.4.1 (still the default on ubuntu 14.03 LTS).
>  > I attach an emacs window screen shot, which at least Vitalie and Tamas will get.
>
>  > (R 3.2.0 patched, "current";  emacs 15.09-devel "current")
>
>  > Martin
>
>  > On Mon, May 11, 2015 at 1:23 AM, Vitalie Spinu <spinuvit using gmail.com> wrote:
>  >>
>  >> We are not even getting those delimiters because TERM var is "dumb" by
>  >> default. You can either:
>  >>
>  >> Sys.setenv(TERM = "xterm-256color")
>  >>
>  >> directly in R, or prepend that to process-environment in emacs.
>  >>
>  >> Vitalie
>  >>
>  >>
>  >> >>> Tamas Papp on Sun, 10 May 2015 17:28:49 +0200 wrote:
>  >>
>  >> > On Fri, May 08 2015, Vitalie Spinu <spinuvit using gmail.com> wrote:
>  >>
>  >> >> >>> Tamas Papp on Fri, 08 May 2015 13:23:54 +0200 wrote:
>  >> >>
>  >> >> > Hi,
>  >> >> > I saw some R packages that implement ANSI escapes in R and Julia, eg
>  >> >> > https://github.com/gaborcsardi/crayon . But when I tried this in ESS/R,
>  >> >> > the output was unchanged, in Julia I saw the escapes.
>  >> >>
>  >> >> There is ansi-color-process-output in comint-output-filter-functions so
>  >> >> it should work in principle. But, as R is not producing any of shush, it
>  >> >> was never tested.
>  >> >>
>  >> >> If you give a small reproducible example that works in terminal but not
>  >> >> in ESS, I might have a look at it.
>  >>
>  >> > Hi Vitalie,
>  >>
>  >> > This works in the terminal, but not in Emacs/ESS (versions below):
>  >>
>  >> > install.packages("crayon")
>  >> > library(crayon)
>  >> > cat(green("test\n"))
>  >>
>  >> > Should print "test" in green.
>  >>
>  >> > Thanks for looking into this.
>  >>
>  >> > Best,
>  >>
>  >> > Tamas
>  >>
>  >> > PS.: Versions:
>  >>
>  >> > GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5) of
>  >> > 2015-03-07 on trouble, modified by Debian
>  >>
>  >> > ess-version: 15.09-devel [elpa: 20150423.923] (loaded from /home/tamas/.emacs.d/elpa/ess-20150423.923/)
>  >>
>  >> > R version:
>  >> >                _
>  >> > platform       x86_64-pc-linux-gnu
>  >> > arch           x86_64
>  >> > os             linux-gnu
>  >> > system         x86_64, linux-gnu
>  >> > status
>  >> > major          3
>  >> > minor          2.0
>  >> > year           2015
>  >> > month          04
>  >> > day            16
>  >> > svn rev        68180
>  >> > language       R
>  >> > version.string R version 3.2.0 (2015-04-16)
>  >> > nickname       Full of Ingredients
>  >>
>  >> > Crayon: 2015-04-09 00:30:34
>  >>
>  >> ______________________________________________
>  >> ESS-help using r-project.org mailing list
>  >> https://stat.ethz.ch/mailman/listinfo/ess-help>
>
>
>

>
>
>  >>> Martin Maechler on Mon, 11 May 2015 23:02:05 +0200 wrote:
>
>  > Interestingly, this *works* extremely nicely for me,  using emacs
>  > 23.4.1 (still the default on ubuntu 14.03 LTS).
>  > I attach an emacs window screen shot, which at least Vitalie and Tamas will get.
>
>  > (R 3.2.0 patched, "current";  emacs 15.09-devel "current")
>
>  > Martin
>
>  > On Mon, May 11, 2015 at 1:23 AM, Vitalie Spinu <spinuvit using gmail.com> wrote:
>  >>
>  >> We are not even getting those delimiters because TERM var is "dumb" by
>  >> default. You can either:
>  >>
>  >> Sys.setenv(TERM = "xterm-256color")
>  >>
>  >> directly in R, or prepend that to process-environment in emacs.
>  >>
>  >> Vitalie
>  >>
>  >>
>  >> >>> Tamas Papp on Sun, 10 May 2015 17:28:49 +0200 wrote:
>  >>
>  >> > On Fri, May 08 2015, Vitalie Spinu <spinuvit using gmail.com> wrote:
>  >>
>  >> >> >>> Tamas Papp on Fri, 08 May 2015 13:23:54 +0200 wrote:
>  >> >>
>  >> >> > Hi,
>  >> >> > I saw some R packages that implement ANSI escapes in R and Julia, eg
>  >> >> > https://github.com/gaborcsardi/crayon . But when I tried this in ESS/R,
>  >> >> > the output was unchanged, in Julia I saw the escapes.
>  >> >>
>  >> >> There is ansi-color-process-output in comint-output-filter-functions so
>  >> >> it should work in principle. But, as R is not producing any of shush, it
>  >> >> was never tested.
>  >> >>
>  >> >> If you give a small reproducible example that works in terminal but not
>  >> >> in ESS, I might have a look at it.
>  >>
>  >> > Hi Vitalie,
>  >>
>  >> > This works in the terminal, but not in Emacs/ESS (versions below):
>  >>
>  >> > install.packages("crayon")
>  >> > library(crayon)
>  >> > cat(green("test\n"))
>  >>
>  >> > Should print "test" in green.
>  >>
>  >> > Thanks for looking into this.
>  >>
>  >> > Best,
>  >>
>  >> > Tamas
>  >>
>  >> > PS.: Versions:
>  >>
>  >> > GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.5) of
>  >> > 2015-03-07 on trouble, modified by Debian
>  >>
>  >> > ess-version: 15.09-devel [elpa: 20150423.923] (loaded from /home/tamas/.emacs.d/elpa/ess-20150423.923/)
>  >>
>  >> > R version:
>  >> >                _
>  >> > platform       x86_64-pc-linux-gnu
>  >> > arch           x86_64
>  >> > os             linux-gnu
>  >> > system         x86_64, linux-gnu
>  >> > status
>  >> > major          3
>  >> > minor          2.0
>  >> > year           2015
>  >> > month          04
>  >> > day            16
>  >> > svn rev        68180
>  >> > language       R
>  >> > version.string R version 3.2.0 (2015-04-16)
>  >> > nickname       Full of Ingredients
>  >>
>  >> > Crayon: 2015-04-09 00:30:34
>  >>
>  >> ______________________________________________
>  >> ESS-help using r-project.org mailing list
>  >> https://stat.ethz.ch/mailman/listinfo/ess-help>
>
>
>




More information about the ESS-help mailing list