wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

Allow hyperlinks in tab bar status

Open Yanrishatum opened this issue 2 months ago • 2 comments

Is your feature request related to a problem? Please describe. Currently there's no way to create mouse-interactive elements in tab status area. It limits the ways it can be utilized.

Describe the solution you'd like Add support for OSC8/hyperlinks for window:set_left_status and window:set_right_status. Potentially support hyperlinks in tabs as well.

Describe alternatives you've considered There's no alternative.

Additional context While this won't substitute as proper "buttons" as is, it will allow users to add some kind of interactivity to the status bar.

  • Making them appear as buttons can be supported with type=button hyperlink parameter.
  • May be handled as a separate from open-uri event?
  • Styling of status-bar buttons can be controller via config.colors.*_hyperlink fields:
    • status_hyperlink[_hover] for status bar hyperlinks, [in]active_tab_hyperlink[_hover] for tab hyperlinks.
    • For extra customizability: Support style=name parameters, which would use different colors entry. I.e. style=error would use status_hyperlink_error[_hover] styling.
  • Use-case examples: "Open CWD in file browser" for local domain; ", "switch workspace" button, "duplicate pane" quick button, just any "I sometimes click to do thing" action.

Use-case example: Adding a dedicated "close" button to the right status bar that would close the current active pane:

wezterm.on('open-uri', function(window, pane, uri)
  -- Handle wez: hyperlinks as commands to Wezterm
  local command = uri:match('^wez:(.+)$');
  if command then
    if command == 'close-pane' then
      window:perform_action(wezterm.action.CloseCurrentPane { confirm = true }, pane)
    end
    return false
  end
end)
wezterm.on('update-right-status', function(window, pane)
  window:set_right_status(wezterm.format {
    -- Show "close" button that will close the current pane
    { Text = '\x1b]8;type=button;wez:close-pane\x1b\\ '..wezterm.nerdfonts.cod_close .. '  \x1b]8;;\x1b\\' },
  })
end)

If hyperlinks in tabs are supported - this will also allow creating close tab button for non-fancy tab bar (I personally hate the fancy one, it has rounded corners AND has wasted space)

My personal use-case: Custom INTEGRATED_BUTTONS, since I want to use wezterm as a single-instance gui (no windows, only tabs) and hide into tray when unused. I.e. have _ [] X that would respectively: hide into tray; maximize; either hide into tray or close when clicked while holding shift. I already handle hiding into tray via AHK script listening on Ctrl+~, but would've been nice if I could also integrate that behavior into UI.

Yanrishatum avatar Nov 04 '25 04:11 Yanrishatum

Note: ~~duplicate of~~ related to #7304 & #3877

bew avatar Nov 04 '25 07:11 bew

I wouldn't say it's a pure duplicate. #7304 seem to request similar feature but as a separate status panel and doesn't specify the way it's controlled. My request specifically targets handling of hyperlinks as a solution to lack of mouse interactivity. #3877 is completely different, as it's about introducing an event triggered for entire status bar when user interacts with it or defining custom panel with list of buttons.

My request focuses primarily on supporting hyperlinks, and the extra notes about expanded support like styling and presenting them as buttons is supplemental.

Yanrishatum avatar Nov 04 '25 07:11 Yanrishatum