/ wezterm / events / new-tab-button.lua
new-tab-button.lua
 1  local wezterm = require('wezterm')
 2  local nf = wezterm.nerdfonts
 3  
 4  local M = {}
 5  
 6  M.setup = function()
 7    wezterm.on('new-tab-button-click', function(window, pane, button, default_action)
 8      wezterm.log_info('new-tab', window, pane, button, default_action)
 9      if default_action and button == 'Left' then
10        window:perform_action(default_action, pane)
11      end
12  
13      if default_action and button == 'Right' then
14        window:perform_action(
15          wezterm.action.ShowLauncherArgs({
16            title = nf.fa_rocket .. '  Select/Search:',
17            flags = 'FUZZY|LAUNCH_MENU_ITEMS|DOMAINS',
18          }),
19          pane
20        )
21      end
22      return false
23    end)
24  end
25  
26  return M