Hey @Kyle_M ,
Just to confirm, when you choose “always rerun” via the UI the setting only lasts for that session — and this is indeed on purpose
To make the setting persist, you should add the following to the config file at ~/.streamlit/config.toml, as you noted:
runOnSave = true
The thinking behind that was that many of our early users started by taking an existing Python file which takes a long time to run and sprinkling some Streamlit magic on it. While they iterate on it they often save their work, either to make sure it doesn’t get lost if their editor crashes, or even just due to force of habit. With
runOnSave turned on, while users are refactoring their script the rerun could be very CPU intensive and slow.
Or worse, many times the original script is destructive: rerunning it will overwrite some files, update a database, etc. This is something the user will likely want to fix as they convert the script to Streamlit, but while they’re still in the middle of this work it may still be an issue.
So, out of caution, we decided to default
off and listen to the community for possible future improvements.