Metasyntactical 0 Posted March 3, 2019 Share 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 Link to post Share on other sites
1 Solution payonel 21 Posted March 4, 2019 Solution Share 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 Link to post Share on other sites
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:
Link to post
Share on other sites