wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

`prefer_to_spawn_tabs` should also focus the window the tab is spawned in

Open LWY1Nwzt opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe.

I'm using a nightly build that supports prefer_to_spawn_tabs. Currently the tab is spawned but the terminal isn't focused automatically. This is imo a somewhat unexpected behavior for this kind of action -- I'd expect the terminal to get the focus so I can immediately work in my new tab.

Describe the solution you'd like With prefer_to_spawn_tabs = true the terminal in which the new tab is spawned should automatically be focused.

Describe alternatives you've considered

I don't know if there's an easier solution, but currently I'm using a workaround:
I set a user var in my .bashrc, e.g.

printf "\033]1337;SetUserVar=%s=%s\007" foo $(echo -n bar | base64)

and simply focus the window via the wezterm config

wezterm.on('user-var-changed', function(window, pane, name, value)
  window:focus()
end)

Additional context

I guess this would mimic the "normal" behavior where each invocation of wezterm focuses the newly spawned terminal.

LWY1Nwzt avatar Feb 09 '24 16:02 LWY1Nwzt