2022-07-07 02:02:29 +03:00
|
|
|
## `window:spawn_tab{}`
|
|
|
|
|
|
|
|
*Since: 20220624-141144-bd1b7c5d*
|
|
|
|
|
|
|
|
Spawns a program into a new tab within this window, returning the
|
2022-07-19 17:17:12 +03:00
|
|
|
[MuxTab](../MuxTab/index.md), [MuxPane](../MuxPane/index.md) and
|
2022-07-07 02:02:29 +03:00
|
|
|
[MuxWindow](index.md) objects associated with it:
|
|
|
|
|
|
|
|
```lua
|
2022-07-19 17:54:31 +03:00
|
|
|
local tab, pane, window = window:spawn_tab {}
|
2022-07-07 02:02:29 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
When no arguments are passed, the default program is spawned.
|
|
|
|
|
|
|
|
The following parameters are supported:
|
|
|
|
|
|
|
|
### args
|
|
|
|
|
|
|
|
Specifies the argument array for the command that should be spawned.
|
|
|
|
If omitted the default program for the domain will be spawned.
|
|
|
|
|
|
|
|
```lua
|
2022-07-19 17:54:31 +03:00
|
|
|
window:spawn_tab { args = { 'top' } }
|
2022-07-07 02:02:29 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
### cwd
|
|
|
|
|
|
|
|
Specify the current working directory that should be used for
|
|
|
|
the program.
|
|
|
|
|
|
|
|
If unspecified, follows the rules from [default_cwd](../config/default_cwd.md)
|
|
|
|
|
|
|
|
```lua
|
2022-07-19 17:54:31 +03:00
|
|
|
window:spawn_tab { cwd = '/tmp' }
|
2022-07-07 02:02:29 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
### set_environment_variables
|
|
|
|
|
|
|
|
Sets additional environment variables in the environment for
|
|
|
|
this command invocation.
|
|
|
|
|
|
|
|
```lua
|
2022-07-19 17:54:31 +03:00
|
|
|
window:spawn_tab { set_environment_variables = { FOO = 'BAR' } }
|
2022-07-07 02:02:29 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
### domain
|
|
|
|
|
|
|
|
Specifies the multiplexer domain into which the program should
|
|
|
|
be spawned. The default value is assumed to be `"CurrentPaneDomain"`,
|
|
|
|
which causes the domain from the currently active pane to be used.
|
|
|
|
|
|
|
|
You may specify the name of one of the multiplexer domains
|
|
|
|
defined in your configuration using the following:
|
|
|
|
|
|
|
|
```lua
|
2022-07-19 17:54:31 +03:00
|
|
|
window:spawn_tab { domain = { DomainName = 'my.name' } }
|
2022-07-07 02:02:29 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
|