wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

Support `get_foreground_process_info`, `get_tty_name`, ... for multiplexer panes

Open nghialm269 opened this issue 2 years ago • 3 comments

Is your feature request related to a problem? Please describe. I'm trying to replace tmux with wezterm's multiplexer completely. I have a keymap that acts differently depending on the foreground process. However, according to the documentation, it's not supported.

Describe the solution you'd like Add support for get_foreground_process_info, get_tty_name, and other similar functionalities in multiplier panes.

Describe alternatives you've considered N/A

Additional context N/A

nghialm269 avatar Nov 08 '23 11:11 nghialm269

It's not supported because there is no efficient way to obtain that data; it has to be polled. The local version of these polls with a cache, but for a remote version to work effectively we would have to continually poll across the network connection, or otherwise set up something to continually poll on the server side. The cost of these system introspection functions is rather high, so a continual polling scheme is undesirable and will likely get filed as a performance bug against wezterm; there are already a couple of bugs filed for the polling/caching behavior for local panes.

As an alternative, I recommend using Shell Integration and/or User Vars to more efficiently pass state back to the lua code in your wezterm config.

wez avatar Jan 24 '24 23:01 wez

@wez: hmm I'm trying to use the WEZTERM_PROG user var instead, but it's always empty whether I'm in a normal or a multiplexer pane.

{
    "WEZTERM_HOST": "*redacted*",
    "WEZTERM_IN_TMUX": "0",
    "WEZTERM_PROG": "",
    "WEZTERM_USER": "nghialm",
}

I can see the function __wezterm_set_user_var so i think Shell Integration loaded.

nghialm269 avatar Feb 07 '24 15:02 nghialm269

Please open a separate issue for the WEZTERM_PROG issue, and be sure to include more detail about the shell and other stuff that is going on over there

wez avatar Feb 08 '24 11:02 wez