Skip to content

Commit

Permalink
default disable kitty graphics until support is improved
Browse files Browse the repository at this point in the history
You can run `wezterm --config enable_kitty_graphics=true` to do ad-hoc
tests with the protocol enabled.

refs: #986
refs: #1998
  • Loading branch information
wez committed Jul 31, 2021
1 parent 159abe5 commit fb9338f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,6 +791,10 @@ pub struct Config {
#[serde(default = "default_initial_rows")]
pub initial_rows: u16,

/// Disabled by default until the implementation is complete enough
#[serde(default)]
pub enable_kitty_graphics: bool,

/// Specifies the width of a new window, expressed in character cells
#[serde(default = "default_initial_cols")]
pub initial_cols: u16,
Expand Down
4 changes: 4 additions & 0 deletions config/src/terminal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,8 @@ impl wezterm_term::TerminalConfiguration for TermConfig {
fn enq_answerback(&self) -> String {
configuration().enq_answerback.clone()
}

fn enable_kitty_graphics(&self) -> bool {
self.configuration().enable_kitty_graphics
}
}
4 changes: 4 additions & 0 deletions term/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,8 @@ pub trait TerminalConfiguration: std::fmt::Debug {
fn enq_answerback(&self) -> String {
"".to_string()
}

fn enable_kitty_graphics(&self) -> bool {
false
}
}
3 changes: 3 additions & 0 deletions term/src/terminalstate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1801,6 +1801,9 @@ impl TerminalState {
}

fn kitty_img(&mut self, img: KittyImage) -> anyhow::Result<()> {
if !self.config.enable_kitty_graphics() {
return Ok(());
}
match img {
KittyImage::TransmitData {
transmit,
Expand Down

0 comments on commit fb9338f

Please sign in to comment.