Files
LLeMbas-TTY/docs/config/lua/keyassignment/SpawnTab.md
T
Wez Furlong 0f8146b212 docs: shift from return {} style to config.something style
Nudge new users towards using this style:

```lua
local config = {}
config.color_scheme = 'Batman'
return config
```

and surface how to write lua modules closer to the main section
on config files. In that lua modules section, nudge towards using
a convention similar to that of the plugin spec described in
this commit: e4ae8a844d
2023-03-19 18:26:21 -07:00

757 B

SpawnTab

Create a new tab in the current window. The argument defines to which domain the tab belongs:

local act = wezterm.action

config.keys = {
  -- Create a new tab in the same domain as the current pane.
  -- This is usually what you want.
  {
    key = 't',
    mods = 'SHIFT|ALT',
    action = act.SpawnTab 'CurrentPaneDomain',
  },
  -- Create a new tab in the default domain
  { key = 't', mods = 'SHIFT|ALT', action = act.SpawnTab 'DefaultDomain' },
  -- Create a tab in a named domain
  {
    key = 't',
    mods = 'SHIFT|ALT',
    action = act.SpawnTab {
      DomainName = 'unix',
    },
  },
}

See SpawnCommandInNewTab for a more flexible action that allows more control over the spawned command.