Metasyntactical Posted March 3, 2019 Posted March 3, 2019 I'm attempting to auto run a program using .shrc that starts a separate detached thread. If I run the program manually, the thread detaches properly. If I run it from .shrc on startup, it runs but does not detach. Thoughts? Example: local thread = require("thread"); local listenerService = thread.create( function() --Do Stuff-- end ) listenerService:detach() Quote
1 payonel Posted March 4, 2019 Posted March 4, 2019 .shrc is run as a list of shell commands, not lua code when you are running the file directly, the shell interpreter is guessing it is lua code, even though the extension is not .lua to accomplish what you want, store your lua code in a separate file, for example a file named test.lua, and in your .shrc write the line: ./test.lua (or just test) Quote
I'm attempting to auto run a program using .shrc that starts a separate detached thread.
If I run the program manually, the thread detaches properly. If I run it from .shrc on startup, it runs but does not detach. Thoughts?
Example: