Support `get_foreground_process_info`, `get_tty_name`, ... for multiplexer panes
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
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: 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.
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