Log In  

I'm trying to run a /system/util command from my own custom /appdata/system/util command, but I can't seem to get the output from the /system/util to show up when I run it.

For example, let's take a dumb example and pretend I want a custom command called sys_ls to list the contents of the system folder. I would think my /appdata/system/util/sys_ls.lua would look like this:

create_process("/system/util/ls.lua", {
    argv = {"/system"}
})

And then running sys_ls should spit out the same output as if I ran ls /system. But it doesn't. Instead it outputs nothing at all.

Any idea how to get the called command's output to actually display in terminal along with any other output from a custom command?

P#147075 2024-04-21 19:37 ( Edited 2024-04-22 15:24)

2

I figured it out! I dug through terminal.lua and found an environment variable print_to_proc_id that needs to be set so it prints correctly to the terminal. The above code works correctly when modified to:

create_process("/system/util/ls.lua", {
    print_to_proc_id = env().print_to_proc_id,
    argv={"/system"}
})
P#147115 2024-04-22 15:24

[Please log in to post a comment]