Skip to content
Prev 151608 / 398498 Next

R command history -- can it be like Matlab's?

Prof Brian Ripley wrote:
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)