Hi,
Following the idea in "Proposed patch to fix issues with command line file loading", here is a rewritten load_startup_files(), which:
1. Always loads the CL project. Currently it's ignored if "Load files from the last session" is unchecked, which is certainly a bug.
(Well, almost always: if a primary instance is running and -i is not specified, the CL project should be open in the primary instance, but on my system that doesn't happen. Doesn't look like a problem with load_starup_files(), so ignoring it for now.)
2. Always loads the CL files. Presently, any files specified after the project file are ignored; I could not find a reason for this, other than the layout of the current load_startup_files(), and it's marked with ATM, aka "at the moment". Well, the moment came.
3. Ignores --no-session if specified together with a CL project and "Project based session files" is checked (it normally is). In this situation, the old implementation opens the project with an empty file list, which is then saved in the project - I believe nobody would want that. Attempting to "properly" (whatever that may be) apply -s to projects creates various problems.
4. Is cleaner, a bit shorter (except for the comments), and can be easily customized for things like XSM, preference to load the default session even if CL files are specified etc.
I'd like this thread to be for fixing the current startup behaviour only. If you want any new functionality, please open a new thread, or continue "Proposed patch to fix issues [...]". Thanks in advance.