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

Access Shell From Inside A Program

Started by hbomb79, 15 June 2014 - 06:46 AM
hbomb79 #1
Posted 15 June 2014 - 08:46 AM
I would like to be able to call a shell up in my program… ive seen Operating systems on the forum do this before, how would i and if possible is it possible for lets say if i type "exit()" in it it will return to the program?
Lignum #2
Posted 15 June 2014 - 10:27 AM
Not sure if this is what you mean but:

shell.run("shell")
This will run a second shell that will return to your program when it's exited.
However, keep in mind that shell.run will pause your program (unless you're using coroutines) until the other program is finished and all of the changes the program made to the screen will stay even when your program has control again. So if you've got a GUI, you should re-render it after shell.run.
Bomb Bloke #3
Posted 15 June 2014 - 10:35 AM
Under ComputerCraft 1.6 onwards, advanced systems have also got the option of shell.openTab().