Re: [R] R command history -- can it be like Matlab's?

From: Gad Abraham <gabraham_at_csse.unimelb.edu.au>
Date: Wed, 30 Jul 2008 18:29:47 +1000

Prof Brian Ripley wrote:
> A patch to do this was posted on 2007-09-29 by Glenn Davis. Some people
> not addicted to Matlab find the behaviour very inconvenient and prefer
> the getline/readline behaviour (triggered by ^R/^S) of Rterm and R on
> Unixen.

Now that you've mentioned readline, it doesn't behave exactly the same in Bash and R: if you press ctrl-r and then ctrl-c in Bash, it breaks the search and you go back to the prompt as normal. In R on Linux (all versions I've tried, 2.2 to 2.7.1), doing that returns you to the prompt but you can't type anything, and the input buffer retains the text from the search, so pressing enter makes the historical command run again.

Try this:
 > ls()
character(0)
[ctrl-r]
(reverse-i-search)`l': ls()
[ctrl-c, then enter]
 > ls()
character(0)

-- 
Gad Abraham
Dept. CSSE and NICTA
The University of Melbourne
Parkville 3010, Victoria, Australia
email: gabraham_at_csse.unimelb.edu.au
web: http://www.csse.unimelb.edu.au/~gabraham

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Wed 30 Jul 2008 - 08:34:37 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 02 Aug 2008 - 10:33:03 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive