#133 ENQ response

This commit is contained in:
Autumn Lamonte authored and Wez Furlong committed 2021-07-24 23:36:20 -07:00
1 parent 70544b7b26
commit ce9d166733
4 files changed
+24

No files matched your search

+7
View File
@@ -1149,6 +1149,9 @@ pub struct Config {
#[serde(default = "default_word_boundary")]
pub selection_word_boundary: String,
#[serde(default = "default_enq_answerback")]
pub enq_answerback: String,
#[serde(default = "default_true")]
pub adjust_window_size_when_changing_font_size: bool,
@@ -1217,6 +1220,10 @@ fn default_word_boundary() -> String {
" \t\n{[}]()\"'`".to_string()
}
fn default_enq_answerback() -> String {
"".to_string()
}
fn default_one_point_oh_f64() -> f64 {
1.0
}
+4
View File
@@ -62,4 +62,8 @@ impl wezterm_term::TerminalConfiguration for TermConfig {
fn alternate_buffer_wheel_scroll_speed(&self) -> u8 {
self.configuration().alternate_buffer_wheel_scroll_speed
}
fn enq_answerback(&self) -> String {
configuration().enq_answerback.clone()
}
}
+4
View File
@@ -72,4 +72,8 @@ pub trait TerminalConfiguration: std::fmt::Debug {
fn alternate_buffer_wheel_scroll_speed(&self) -> u8 {
3
}
fn enq_answerback(&self) -> String {
"".to_string()
}
}
+9
View File
@@ -3519,6 +3519,15 @@ impl<'a> Performer<'a> {
ControlCode::ShiftOut => {
self.shift_out = true;
}
ControlCode::Enquiry => {
let response = self.config.enq_answerback();
if response.len() > 0 {
write!(self.writer, "{}", response).ok();
self.writer.flush().ok();
}
}
_ => log::warn!("unhandled ControlCode {:?}", control),
}
}