This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Hiran's profile picture

multishell access

Started by Hiran, 07 October 2014 - 10:13 AM
Hiran #1
Posted 07 October 2014 - 12:13 PM
By default you dont have access to multishell in new tabs so running

multishell.launch({},"rom/programs/lua")
and in new tab

print (shell)
print (multishell)
will both show nil

Should i change it so that you would have access to both apis from anywhere, or only my parent shell should be able to create etc new shells?

edit:

I know that i can pass them with first parameter, but i want to know if i should make it default.
Edited on 07 October 2014 - 10:19 AM
Bomb Bloke #2
Posted 07 October 2014 - 12:38 PM
I'd say that access to shell is pretty important for quite a few scripts. multishell, not so much, but I don't see why you'd want to block it.
Hiran #3
Posted 07 October 2014 - 01:19 PM
theyre blocked by default, and im asking if i should unlock them :)/>

edit:

if you use:

multishell.launch({},"rom/programs/shell")
and then enter lua you will see shell table, but multishell will still be inaccessible.
Edited on 07 October 2014 - 11:21 AM
Bomb Bloke #4
Posted 07 October 2014 - 01:32 PM
theyre blocked by default, and im asking if i should unlock them :)/>

Not so much "blocked" as "just not included". I'm saying your best bet is to provide them unless you can specifically think of a good reason not to - for example, if you've coded up your own replacements with which you wish to fill the gap.
MKlegoman357 #5
Posted 07 October 2014 - 02:05 PM
I would say leave it as it is. Actually, you could make something like 'multishell.run(program, arguments…)' which could work like 'shell.run()' passing shell and multishell APIs to the program.
Hiran #6
Posted 07 October 2014 - 04:06 PM
Im thinking of making something more gui-like, so ill probably go with Bomb Bloke advice and force-include them in every shell.
Making my own replacements isnt a good idea, as it will conflict with programs not created by me, and i want to reduce conflicts by as much as i can.
natedogith1 #7
Posted 07 October 2014 - 10:47 PM
Is there a reason you're using multishell.launch instead of shell.openTab ?