[ESS] Open R in an external terminal?

Mathieu Basille basille at ase-research.org
Fri Nov 11 03:03:04 CET 2011

The closer I can see is by using screen, so that you can attach and 
detach a R session as you wish (which means using it within Emacs, or 
directly from the terminal, or...):

- In a regular terminal, open a screen session:

$ screen -S rsession

and detach it (C-a C-d).

- In Emacs, open a .R file. Divide the frame in two (C-x 2) and open a 
shell in emacs (M-x shell). You need then clearing capabilities that you 
can have with:


- Now restore your screen session:

screen -r rsession

- Open R as with a regular terminal, and use ESS-remote (M-x ess-remote) 
to associate this buffer to ESS.

This said, screen shortcuts now conflicts with Emacs ones... I then have 
this in my .emacs:

;; used to send screen keybindings to shell in emacs
(define-key shell-mode-map (kbd "C-l") (lambda (seq) (interactive "k")
     (process-send-string nil seq)))
(define-key inferior-ess-mode-map (kbd "C-l") (lambda (seq)
     (interactive "k") (process-send-string nil seq)))

To detach a screen session, you then need to type C-l C-a C-l C-d...

Is this what you want?

Le 10/11/2011 20:42, Harold Pimentel a écrit :
>> You can't serisouly ask for:
>> - Open a terminal
>> - Type 'R' and enter...
> No.
> I would like to open an external R session and still use the ESS
> commands to send regions, buffers, etc. to R. I realize this breaks
> the Emacs philosophy, but it is still something I would like to do.
> Thanks,
> Harold


~$ whoami
Mathieu Basille, Post-Doc

~$ locate
Laboratoire d'Écologie Comportementale et de Conservation de la Faune
+ Centre d'Étude de la Forêt
Département de Biologie
Université Laval, Québec

~$ info

~$ fortune
``If you can't win by reason, go for volume.''
Calvin, by Bill Watterson.

More information about the ESS-help mailing list