I have ingrained in my muscle memory to press "ctrl+s" every time before I run a .do file in case Stata crashes. Once in a while I write code directly into the Stata command field, especially when I tabulate or summarise variables I just created to quality check them. I have thus accidently managed to press "ctrl+s" while in this window accidentaly, and followingly press enter with the intent to execute the command I wrote into the command window. This of course, replaces the data set I am working on, which I extremely seldomly want to do, and especially not outside of a .do file.

Is there a way to never allow Stata to overwrite a specific file? In the .do file I use the "replace" option to force Stata to overwrite, but I could not find any options to "lock" the data set. I couldn't find an option anywhere to dissalow the "ctrl+s" on saving data sets. I wanted to ask if there is some information I am missing?