Multishell allows multiple programs to be run at the same time.
When multiple programs are running, it displays a tab bar at the top of the
screen, which allows you to switch between programs. New programs can be
launched using the
bg programs, or using the
Each process is identified by its ID, which corresponds to its position in the tab list. As tabs may be opened and closed, this ID is not constant over a program's run. As such, be careful not to use stale IDs.
multishell is not a "true" API. Instead, it is a
standard program, which launches a shell and injects its API into the shell's
environment. This API is not available in the global environment, and so is
not available to APIs.
- New in version 1.6
|getFocus()||Get the currently visible process.|
|setFocus(n)||Change the currently visible process.|
|getTitle(n)||Get the title of the given tab.|
|setTitle(n, title)||Set the title of the given process.|
|getCurrent()||Get the index of the currently running process.|
|launch(tProgramEnv, sProgramPath, ...)||Start a new process, with the given environment, program and arguments.|
|getCount()||Get the number of processes within this multishell.|
Get the currently visible process. This will be the one selected on the tab bar.
Note, this is different to
getCurrent, which returns the process which is currently executing.
numberThe currently visible process's index.
Change the currently visible process.
numberThe process index to switch to.
booleanIf the process was changed successfully. This will return
falseif there is no process with this id.
Get the title of the given tab.
This starts as the name of the program, but may be changed using
numberThe process index.
string| nil The current process title, or
nilif the process doesn't exist.
- setTitle(n, title)Source
Set the title of the given process.
numberThe process index.
stringThe new process title.
Change the title of the current process
Get the index of the currently running process.
numberThe currently running process.
- launch(tProgramEnv, sProgramPath, ...)Source
Start a new process, with the given environment, program and arguments.
The returned process index is not constant over the program's run. It can be safely used immediately after launching (for instance, to update the title or switch to that tab). However, after your program has yielded, it may no longer be correct.
tableThe environment to load the path under.
stringThe path to the program to run.
- ... Additional arguments to pass to the program.
numberThe index of the created process.
Run the "hello" program, and set its title to "Hello!"
Get the number of processes within this multishell.
numberThe number of processes.