[BioC] R command history on unix version

James W. MacDonald jmacdon at med.umich.edu
Wed Jun 14 16:54:43 CEST 2006

Hi Jianping,

Jianping Jin wrote:
> Dear list:
> On the Windows version one can bring back R command history at the prompt 
> by using a up-ward arrow key. Unfortunately I can not do the same thing on 
> a Sun unix machine. I am wondering if one can set up the history function 
> or command editing function, what ever you call that, with the unix version 
> of R?

It depends on how you run R. If you are running at a terminal prompt, 
then I think you have to have readline installed. In that case, you can 
use up and down arrows just like on win32. However, running at a 
terminal is IMO really not the way to do things. I much prefer to use 
Xemacs/ESS with R as an inferior process. In that case you can use M-p 
and M-n (Alt-p and Alt-n for non-(X)emacs folks) to go up and down in 
the history.

On win32, adding this to my init.el file makes the up and down arrows 
work just like the Rgui, but doesn't seem to work on Linux.

       (setq comint-scroll-to-bottom-on-output 'others) ; not current
       ;;=default: (setq comint-scroll-to-bottom-on-input nil)
       (setq comint-scroll-show-maximum-output t) ;;; this is the key
       (define-key comint-mode-map [up]
       (define-key comint-mode-map [down]

       (define-key comint-mode-map "\C-a" 'comint-bol)))



> Thanks in advance!
> Jianping
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> x Jianping Jin Ph.D.            x
> x Bioinformatics scientist      x
> x Center for bioinformatics     x
> x 3133 Bioinformatics Building  x
> x CB# 7104                      x
> x University of North Carolina  x
> x Chapel Hill, NC 27599         x
> x Tel: (919)843-6105            x
> x Fax: (919)843-3103            x
> x E-mail: jjin at email.unc.edu    x
> xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> _______________________________________________
> Bioconductor mailing list
> Bioconductor at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/bioconductor
> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor

James W. MacDonald, M.S.
Affymetrix and cDNA Microarray Core
University of Michigan Cancer Center
1500 E. Medical Center Drive
7410 CCGC
Ann Arbor MI 48109

Electronic Mail is not secure, may not be read every day, and should not be used for urgent or sensitive issues.

More information about the Bioconductor mailing list