What function (if any) is called when pressing Ctrl+D to exit R repl? I saw in a few questions, such as:
code that led me to believe it's calling either function q
or quit
.
The reason I want to override is to make the pesky:
Save workspace image? [y/n/c]:
prompt on exit go away. However, overriding the function in .Rprofile
such as:
quit <- function(...) {
print(1)
}
and similarly for q
did not work - i.e. pressing Ctrl-D did not actually print number 1, went straight to the prompt.
The solutions presented in the above links did not seem to work. R version used:
R version 2.15.2 (2012-10-26) -- "Trick or Treat"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-pc-linux-gnu (64-bit)