diff --git a/config/src/ssh.rs b/config/src/ssh.rs index b7a9b7a21..08ad3ac30 100644 --- a/config/src/ssh.rs +++ b/config/src/ssh.rs @@ -71,6 +71,13 @@ pub struct SshDomain { #[dynamic(default = "default_local_echo_threshold_ms")] pub local_echo_threshold_ms: Option, + /// Show time since last response when waiting for a response. + /// It is recommended to use + /// + /// instead. + #[dynamic(default)] + pub overlay_lag_indicator: bool, + /// The path to the wezterm binary on the remote host pub remote_wezterm_path: Option, diff --git a/config/src/tls.rs b/config/src/tls.rs index 47eb4d0ed..4e42a883a 100644 --- a/config/src/tls.rs +++ b/config/src/tls.rs @@ -85,6 +85,13 @@ pub struct TlsDomainClient { /// The path to the wezterm binary on the remote host pub remote_wezterm_path: Option, + + /// Show time since last response when waiting for a response. + /// It is recommended to use + /// + /// instead. + #[dynamic(default)] + pub overlay_lag_indicator: bool, } impl TlsDomainClient { diff --git a/config/src/unix.rs b/config/src/unix.rs index c89219f28..50152e44e 100644 --- a/config/src/unix.rs +++ b/config/src/unix.rs @@ -53,6 +53,13 @@ pub struct UnixDomain { /// Don't use default_local_echo_threshold_ms() here to /// disable the predictive echo for Unix domains by default. pub local_echo_threshold_ms: Option, + + /// Show time since last response when waiting for a response. + /// It is recommended to use + /// + /// instead. + #[dynamic(default)] + pub overlay_lag_indicator: bool, } impl Default for UnixDomain { @@ -68,6 +75,7 @@ impl Default for UnixDomain { write_timeout: default_write_timeout(), local_echo_threshold_ms: None, proxy_command: None, + overlay_lag_indicator: false, } } } diff --git a/docs/changelog.md b/docs/changelog.md index 6238f11d1..523c8f60c 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -69,6 +69,12 @@ As features stabilize some brief notes about them will accumulate here. zoomed, only that pane would be returned by those methods. * macOS: CTRL-modified keys are now routed to the IME [#2435](https://github.com/wez/wezterm/pull/2435) +* multiplexer: The lag indicator that gets overlaid on the pane content + when waiting a long time for a response now defaults to disabled. It is + recommended that you [put it into your status + bar](config/lua/pane/get_metadata.md), but you may re-enable the old way + using `overlay_lag_indicator = true` in the appropriate domain + configuration. #### Updated * Bundled Nerd Font Symbols font to v2.2.2 diff --git a/docs/config/lua/SshDomain.md b/docs/config/lua/SshDomain.md index 3593a4bfe..1a352cd84 100644 --- a/docs/config/lua/SshDomain.md +++ b/docs/config/lua/SshDomain.md @@ -130,3 +130,13 @@ return { }, } ``` + +*Since: nightly builds only* + +The lag indicator now defaults to disabled. It is recommended to display +the lag information in your status bar using [this +example](pane/get_metadata.md). + +If you prefer to have the information overlaid on the content area, then +you can set `overlay_lag_indicator = true`, but note that I'd like to +remove that functionality in the future. diff --git a/docs/config/lua/TlsDomainClient.md b/docs/config/lua/TlsDomainClient.md index a35ccdc12..441064ef4 100644 --- a/docs/config/lua/TlsDomainClient.md +++ b/docs/config/lua/TlsDomainClient.md @@ -91,3 +91,13 @@ return { }, } ``` + +*Since: nightly builds only* + +The lag indicator now defaults to disabled. It is recommended to display +the lag information in your status bar using [this +example](pane/get_metadata.md). + +If you prefer to have the information overlaid on the content area, then +you can set `overlay_lag_indicator = true`, but note that I'd like to +remove that functionality in the future. diff --git a/wezterm-client/src/domain.rs b/wezterm-client/src/domain.rs index a72881ef6..490689b3b 100644 --- a/wezterm-client/src/domain.rs +++ b/wezterm-client/src/domain.rs @@ -24,6 +24,7 @@ pub struct ClientInner { pub local_domain_id: DomainId, pub remote_domain_id: DomainId, pub local_echo_threshold_ms: Option, + pub overlay_lag_indicator: bool, remote_to_local_window: Mutex>, remote_to_local_tab: Mutex>, remote_to_local_pane: Mutex>, @@ -139,6 +140,14 @@ impl ClientDomainConfig { } } + pub fn overlay_lag_indicator(&self) -> bool { + match self { + ClientDomainConfig::Unix(unix) => unix.overlay_lag_indicator, + ClientDomainConfig::Tls(tls) => tls.overlay_lag_indicator, + ClientDomainConfig::Ssh(ssh) => ssh.overlay_lag_indicator, + } + } + pub fn label(&self) -> String { match self { ClientDomainConfig::Unix(unix) => format!("unix mux {}", unix.socket_path().display()), @@ -167,6 +176,7 @@ impl ClientInner { local_domain_id: DomainId, client: Client, local_echo_threshold_ms: Option, + overlay_lag_indicator: bool, ) -> Self { // Assumption: that the domain id on the other end is // always the first created default domain. In the future @@ -178,6 +188,7 @@ impl ClientInner { local_domain_id, remote_domain_id, local_echo_threshold_ms, + overlay_lag_indicator, remote_to_local_window: Mutex::new(HashMap::new()), remote_to_local_tab: Mutex::new(HashMap::new()), remote_to_local_pane: Mutex::new(HashMap::new()), @@ -457,8 +468,14 @@ impl ClientDomain { .downcast_ref::() .ok_or_else(|| anyhow!("domain {} is not a ClientDomain", domain_id))?; let threshold = domain.config.local_echo_threshold_ms(); + let overlay_lag_indicator = domain.config.overlay_lag_indicator(); - let inner = Arc::new(ClientInner::new(domain_id, client, threshold)); + let inner = Arc::new(ClientInner::new( + domain_id, + client, + threshold, + overlay_lag_indicator, + )); *domain.inner.borrow_mut() = Some(Arc::clone(&inner)); Self::process_pane_list(inner, panes, primary_window_id)?; diff --git a/wezterm-client/src/pane/renderable.rs b/wezterm-client/src/pane/renderable.rs index 2e639fd5a..abedbac66 100644 --- a/wezterm-client/src/pane/renderable.rs +++ b/wezterm-client/src/pane/renderable.rs @@ -753,7 +753,7 @@ impl RenderableState { } }; - if idx == inner.dimensions.physical_top { + if inner.client.overlay_lag_indicator && idx == inner.dimensions.physical_top { if inner.is_tardy() { let status = format!( "wezterm: {:.0?}⏳since last response",