When I exit the interactive R shell, it displays an annoying prompt every time:
> > Save workspace image? [y/n/c]: n
I\'m always answering \"no\" to it
If, like me, typing out a whole pair of brackets seems like too much effort to exit the repl you can try this:
exit <- structure(list(), class = "exit_command")
print.exit_command <- function(...) {
q("no") # exit without saving
}
This creates a new class, which causes R to exit when attempting to print said class. The upshot being that if you run exit in the R repl, the whole thing will exit (because it tries to print it).
NB: You can add it to ~/.Rprofile to load at the start of every session.