-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow multiple sources of startup files #1796
Comments
This would have side effect of making it so disk drive startup no longer overwrites normal startup. Which was a feature of it basically forever. |
Then it could be implemented with a setting, like |
Technicality here, the bios doesn't actually invoke that startup file, it's done in the shell when there's no parent shell. The routing is: bios -> multishell -> shell -> rom/autorun -> computer startup files -> (first selected) disk drive startup files -> shell input TL;DR for below: The solution is we really shouldn't be using two booleans and instead should be using a string list of either paths to the startup files or drives with roots containing the startup files. I attempt to address them in a way that makes the two booleans backwards comptabile, but it's a downright headache. One solution would be to define a CC-Tweaked/projects/core/src/main/resources/data/computercraft/lua/bios.lua Lines 661 to 665 in 6d32c98
Another idea would be something like
|
Currently, the
bios.lua
handling of startup files only supports a single "source" of user startup files. Specifically, all discovered user startup files are stored in a lua table, but each location that has any such files replaces the existing table, as can be seen on line 207. This means that if you have more than one drive with startup files, only the first such drive returned byperipheral.getNames()
will have its files executed (since line 208 then terminates the loop, and if any disks have startup files then any local ones will not be run.While this isn't actually a security concern, since users can simply disable the
shell.allow_disk_startup
setting, it does prevent users from having a normal startup file to do things like set completion for custom programs and allow disk programs to automatically set themselves up.Currently, the only workaround is to disable
shell.allow_disk_startup
and write a local startup file that then emulates that functionality, searching for attached disks and checking for any startup files on any disks that are found. This is a little clunky and may be prone to error, or at least to edge-case unexpected behaviour, because if the computer itself has multiple startup files in a/startup
directory and the disk loader is only one of them, then it becomes difficult to ensure that all local startup files will run before the disk ones do.To that end, I propose changing the bios functionality to instead append startup files from disks (if enabled via
shell.allow_disk_startup
, of course) so that local files are always run, and then followed by any disk files present.The text was updated successfully, but these errors were encountered: