Back to Wezterm

wezterm.has_action

docs/config/lua/wezterm/has_action.md

latest516 B
Original Source

wezterm.has_action(NAME)

{{since('20230408-112425-69ae8472')}}

Returns true if the string NAME is a valid key assignment action variant that can be used with wezterm.action.

This is useful when you want to use a wezterm configuration across multiple different versions of wezterm.

lua
if wezterm.has_action 'PromptInputLine' then
  table.insert(config.keys, {
    key = 'p',
    mods = 'LEADER',
    action = wezterm.action.PromptInputLine {
      -- other parameters here
    },
  })
end