Difference between revisions of "Shell (API)"
From ComputerCraft Wiki
(Added shell.switchTab and shell.openTab) |
m (Removed NeedsWork tag) |
||
| Line 1: | Line 1: | ||
| − | |||
| − | |||
The shell API allows you to interface with the [http://en.wikipedia.org/wiki/Shell_%28computing%29 shell]. | The shell API allows you to interface with the [http://en.wikipedia.org/wiki/Shell_%28computing%29 shell]. | ||
Revision as of 11:14, 28 March 2014
The shell API allows you to interface with the shell.
| Method Name | Description |
| shell.exit() | Exits the current shell |
| shell.dir() | Returns the directory |
| shell.setDir(string path) | Sets the directory |
| shell.path() | Returns the path |
| shell.setPath(string path) | Sets the path |
| shell.resolve(string localpath) | Resolves a local path to an absolute path. |
| shell.resolveProgram(string name) | Resolves the absolute path to the program whose name you provided. |
| shell.aliases() | Returns aliases. |
| shell.setAlias(string alias, string program) | Sets an alias. |
| shell.clearAlias(string alias) | Clears an alias. |
| shell.programs([boolean hidden]) | Returns a table of programs. |
| shell.run(string program, string arguments) | Runs a program. |
| shell.getRunningProgram() | Returns the absolute path to the currently-executing program. |
| shell.openTab(string program, string arguments) | Runs a program in another multishell tab. Requires version 1.6 or newer and an advanced computer. |
| shell.switchTab(number tab ID) | Switches the multishell tab to tab with the given ID. Requires version 1.6 or newer and an advanced computer. |