Multishell API

Functionmultishell.getCurrent
Returns the ID of the current Tab.
Syntax multishell.getCurrent()
Returns number ID
Part of CC:Tweaked (source)
API multishell
ExampleGet the current Tab ID.
Get the current Tab ID and print it.
Code
<nowiki>
print(multishell.getCurrent())
    </nowiki>
Output
1
Functionmultishell.getCount
Get the number of Multishell Tabs
Syntax multishell.getCount()
Returns number count
Part of CC:Tweaked (source)
API multishell
ExampleGet the number of Multishell Tabs.
Get the number of Multishell Tabs and print it.
Code
<nowiki>
print(multishell.getCount())
    </nowiki>
Output
5
Functionmultishell.getFocus
Returns the id of the focused tab.
Syntax multishell.getFocus()
Returns number id
Part of CC:Tweaked (source)
API multishell
ExampleGet the focused tab id.
Get the focused tab id and print it.
Code
<nowiki>
print(multishell.getFocus())
    </nowiki>
Output
1
Functionmultishell.getTitle
Returns the title of a multishell tab. I the tab doesn't exists, it will return nil.
Syntax multishell.getTitle(
  • tabid : number
)
Returns string title
Part of CC:Tweaked (source)
API multishell
ExampleGet the title of tab 1.
Get the title of tab 1 and print it.
Code
<nowiki>
print(multishell.getTitle(1))
    </nowiki>
Output
shell
Functionmultishell.launch
Run a Program in a new multishell tab.
Syntax multishell.launch(
  • environment : table
  • path : string
  • args...? : any
)
Returns number tabid
Part of CC:Tweaked (source)
API multishell
ExampleLaunch a program in a new tab.
Open the shell in a new tab.
Code
<nowiki>
multishell.launch({},"/rom/programs/shell.lua")
    </nowiki>
Functionmultishell.setFocus
Switch the focus to another multishell tab.
Syntax multishell.setFocus(
  • tabid : number
)
Returns boolean success
Part of CC:Tweaked (source)
API multishell
ExampleSwitch the focus.
Switch the focus to tab 1.
Code
<nowiki>
multishell.setFocus(1)
    </nowiki>
Functionmultishell.setTitle
Set the title of a multishell tab.
Syntax multishell.setTitle(
  • tabid : number
  • title : string
)
Returns nil
Part of CC:Tweaked (source)
API multishell
ExampleSet the title.
Set the title of tab 1 to "Computercraft".
Code
<nowiki>
multishell.setTitle(1,"Computercraft")
    </nowiki>
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.