In my many-years experience TWS on shut-down has always attempted to save the entire session state, ie both configs AND all windows, including ALL charts, as they are at time of manual shut-down. I've never seen indication that this behavior is configurable, but there' so many configs in TWS that I can't say that w/ certainty.
In my experience, If TWS auto-shuts down the session, it's possible that the settings will not be successfully saved.
In my experience, File-SaveSettings saves everything also, but does not shut down TWS. By experience, I mean that when I invoke this and then later load the file it produced, all charts load as they were at the time of that Save. (as for chart templates, they must be first saved individually for them to persist when the session is saved)
If the TWS process is killed rather than manually shut-down, nothing is saved since the most-recent successful save. (There is no auto-save for TWS sessions, one of the many oddities of the program that evoke how software used to be 30 years ago -- n.b. yes, you likely would not want this capab when trading, as TWS can take a long time to save settings)
Years ago, when my TWS sessions had likely exhausted the memory available to them, the standard "Saving Sessions" action prior to shutdown would give up after a few minutes, w/o accomplishing a save. The next session would start w/ the most recently-saved session, ie not the one just exited from.
That has not occured in several years, probably bc I've bumped up the TWS memory allocation config.
Possibly relevant: One of the TWS configs is whether TWS saves settings on the IB server. If selection is NO, then your next session will load from the file saved on your local machine. If you don't save to the TWS server, and if the saved file on your local machine is not available, then you'll probably get an earlier save file from your machine, and if that does not exist, then you'll likely get the generic TWS default config. Note that TWS always saves sessions to your computer when you quit, what changes w/ sever-saved settings ON is that the next TWS startup loads the latest save from the IB server, regardless of what's on your local disk.
Also note that the login window that appears when you first start up TWS has a config for where TWS should save and/or get your session -- wrong file spec here could be a problem ... AND note that the field for entering that spec may not be immediately visible on the login window -- if not, look on the login window for the instruction to see the more detailed login window.
Finally, you can manually save individual charts -- you'll want to do that regularly if you make lots of chart annotations and don't want to lose them if TWS shuts down unintentionally, or fails to save the session on a quit session invocation. Again, using TWS is like a visit to a software time machine, you're always playing defense.