mux: try to avoid shuffling tabs on tls connections

If we hit a timeout for a tab we could mark it dead and remove it
from the containing window.  This isn't desirable for a tls
session that we can reconnect, in part because the timeout is
likely to happen to the last focused tab if connectivity was
suddenly lost (that was the one we were interacting with, so are
likely to have PDUs about to go out), so only that one gets marked
dead and removed from the GUI.

When we re-attach later we may place the tab in the wrong ordinal
position, which is annoying.

This commit seeks to avoid the annoyance by not marking the tab
dead for reconnectable transports.

refs: https://github.com/wez/wezterm/issues/127
This commit is contained in:
Wez Furlong committed 2020-02-27 20:15:04 -08:00
1 parent 52e4837fe2
commit 0e01929caa
2 files changed
+8 -1

No files matched your search

+3
View File
@@ -34,6 +34,7 @@ enum ReaderMessage {
pub struct Client {
sender: PollableSender<ReaderMessage>,
local_domain_id: DomainId,
pub is_reconnectable: bool,
}
macro_rules! rpc {
@@ -644,6 +645,7 @@ impl Reconnectable {
impl Client {
fn new(local_domain_id: DomainId, mut reconnectable: Reconnectable) -> Self {
let is_reconnectable = reconnectable.reconnectable();
let (sender, mut receiver) = pollable_channel().expect("failed to create pollable_channel");
thread::spawn(move || {
@@ -714,6 +716,7 @@ impl Client {
Self {
sender,
local_domain_id,
is_reconnectable,
}
}
+5 -1
View File
@@ -384,7 +384,11 @@ impl RenderableInner {
tab_id: remote_tab_id,
})
.await
.is_ok();
.is_ok()
// if we got a timeout on a reconnectable, don't
// consider the tab to be dead; that helps to
// avoid having a tab get shuffled around
|| client.client.is_reconnectable;
let mux = Mux::get().unwrap();
let tab = mux