You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
savehistory() and loadhistory() fail without an error on Windows #19687
RStudio Edition : Desktop
RStudio Version : main (2026.12 development)
OS Version : Windows
R Version : all
Steps to reproduce the problem
On Windows, run savehistory("C:/no-such-folder/history.Rhistory").
Run loadhistory("no-such-file").
Describe the problem in detail
Both calls return without an error, though nothing was saved or loaded.
On Windows, RStudio replaces utils::savehistory() and utils::loadhistory() with .rs.savehistory() / .rs.loadhistory(), which call rs_saveHistory / rs_loadHistory (src/cpp/r/session/RSession.cpp). rs_saveHistory ignores the error returned by ConsoleHistory::saveToFile(), and rs_loadHistory only writes the error to the session log.
On macOS and Linux, RStudio implements these functions through R's history callbacks instead (Rsavehistory / Rloadhistory in RStdCallbacks.cpp), and both report failures as R errors, e.g. No such file or directory.
Found while working on #19684, where this silence hid a path-encoding bug.
Describe the behavior you expected
savehistory() and loadhistory() raise an error when they can't save or load the file, as they do on macOS and Linux.
Activity
report savehistory() / loadhistory() failures as errors on windows (#…