374 posts
Posted 23 May 2015 - 01:52 AM
So for some reasons (its happened in multiple things of mine and a friends) anytime we run shell.* it errors and drops out of the program. Any known fix?
7508 posts
Location
Australia
Posted 23 May 2015 - 02:43 AM
Chances are it is something you're doing wrong. Please provide code so we can help further.
7083 posts
Location
Tasmania (AU)
Posted 23 May 2015 - 02:54 AM
And the error messages, of course. Why bother asking for help if you're not even going to describe your problem?
That said, scripts that you intend to load via os.loadAPI() don't have access to the shell table (or multishell, for that matter), and therefore shouldn't try to reference it.
374 posts
Posted 23 May 2015 - 03:37 AM
And the error messages, of course. Why bother asking for help if you're not even going to describe your problem?
That said, scripts that you intend to load via os.loadAPI() don't have access to the shell table (or multishell, for that matter), and therefore shouldn't try to reference it.
Am i able to load the shell API from inside the API's themselves? Because if so i need to do that. This may be my issue. I also cant really describe it as its not technically my problem. Im working on an OS with a friend and he has all the updated source code, so i have no code or anything to upload.
8543 posts
Posted 23 May 2015 - 04:06 AM
The shell "API" isn't a real API. It would depend on which shell you want to refer to, and APIs have no knowledge of this, nor should they. If you're making an API and you "need" to access the shell from inside it, you're already Doing It Wrong (TM). There are better (actually correct) ways to do whatever is being attempted.
374 posts
Posted 23 May 2015 - 06:03 AM
The shell "API" isn't a real API. It would depend on which shell you want to refer to, and APIs have no knowledge of this, nor should they. If you're making an API and you "need" to access the shell from inside it, you're already Doing It Wrong ™. There are better (actually correct) ways to do whatever is being attempted.
Our kernel handles everything within its own API but whenever shell.* is called, it breaks. Again, i unfortunately can't give specifics due to my friend having all source and current code.
8543 posts
Posted 23 May 2015 - 07:38 AM
Then we can't help you further. When you post the code, we can provide more help.
374 posts
Posted 23 May 2015 - 07:37 PM
Then we can't help you further. When you post the code, we can provide more help.
Would it realistically be possible to reload the shell API per time i need to use it in a function? or if i possible take the /rom/apis/shell and copy it to a new API and use that?
8543 posts
Posted 23 May 2015 - 10:16 PM
There's no such file as /rom/apis/shell, because the shell isn't a real API. It's a table that's injected into the environment of programs running inside it, and you could have multiple different instances of it at the same time. For instance, in multishell, if you opened two tabs running the shell program, each of them would have an independent shell table that could be modified independently of the other. Which one should your API use? (Hint: The correct answer is neither of them)