mirror of
https://github.com/wez/wezterm.git
synced 2024-11-10 06:34:17 +03:00
parent
3ea030794b
commit
c80cb73ce5
@ -41,6 +41,7 @@ pub struct Client {
|
||||
sender: Sender<ReaderMessage>,
|
||||
local_domain_id: DomainId,
|
||||
pub is_reconnectable: bool,
|
||||
pub is_local: bool,
|
||||
}
|
||||
|
||||
#[derive(Error, Debug, Clone, PartialEq, Eq)]
|
||||
@ -381,6 +382,10 @@ impl Reconnectable {
|
||||
self.stream.take()
|
||||
}
|
||||
|
||||
fn is_local(&mut self) -> bool {
|
||||
matches!(&self.config, ClientDomainConfig::Unix(_))
|
||||
}
|
||||
|
||||
fn reconnectable(&mut self) -> bool {
|
||||
match &self.config {
|
||||
// It doesn't make sense to reconnect to a unix socket; we only
|
||||
@ -784,6 +789,7 @@ impl Reconnectable {
|
||||
impl Client {
|
||||
fn new(local_domain_id: DomainId, mut reconnectable: Reconnectable) -> Self {
|
||||
let is_reconnectable = reconnectable.reconnectable();
|
||||
let is_local = reconnectable.is_local();
|
||||
let (sender, mut receiver) = unbounded();
|
||||
|
||||
thread::spawn(move || {
|
||||
@ -870,6 +876,7 @@ impl Client {
|
||||
sender,
|
||||
local_domain_id,
|
||||
is_reconnectable,
|
||||
is_local,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -106,6 +106,10 @@ impl ClientInner {
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
pub fn is_local(&self) -> bool {
|
||||
self.client.is_local
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
|
@ -133,7 +133,7 @@ impl RenderableInner {
|
||||
/// so we only employ it when it looks like the latency is high.
|
||||
/// We pick 100ms as the threshold for this.
|
||||
fn should_predict(&self) -> bool {
|
||||
self.last_input_rtt >= 100
|
||||
!self.client.is_local() && self.last_input_rtt >= 100
|
||||
}
|
||||
|
||||
/// Compute a "prediction" and apply it to the line data that we
|
||||
|
Loading…
Reference in New Issue
Block a user