diff --git a/crates/prettytty/src/conn.rs b/crates/prettytty/src/conn.rs index 6f6ffb4..1560e8b 100644 --- a/crates/prettytty/src/conn.rs +++ b/crates/prettytty/src/conn.rs @@ -56,6 +56,9 @@ impl Connection { println!("terminal::reconfig {:?}", &reconfig); } reconfig.write(connection.output())?; + if verbose { + println!("terminal::reconfigured") + } Ok(Some(config)) }, )?; diff --git a/crates/prettytty/src/sys/unix.rs b/crates/prettytty/src/sys/unix.rs index 0a17d1e..5b431ab 100644 --- a/crates/prettytty/src/sys/unix.rs +++ b/crates/prettytty/src/sys/unix.rs @@ -132,10 +132,10 @@ impl ModeGroup { use self::ModeGroup::*; match self { - Input => "input", - Output => "output", - Control => "control", - Local => "local" + Input => "input_modes", + Output => "output_modes", + Control => "control_modes", + Local => "local_modes" } } } diff --git a/crates/prettytty/src/sys/windows.rs b/crates/prettytty/src/sys/windows.rs index fe76036..ebbd783 100644 --- a/crates/prettytty/src/sys/windows.rs +++ b/crates/prettytty/src/sys/windows.rs @@ -84,8 +84,8 @@ impl ModeGroup { pub fn name(&self) -> &'static str { match self { - Self::Input => "input", - Self::Output => "output", + Self::Input => "input_modes", + Self::Output => "output_modes", } } } @@ -216,12 +216,16 @@ impl Config { impl std::fmt::Debug for Config { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("Config") - .field("input_modes", &IdentList::new(self.labels(ModeGroup::Input))) - .field("input_encoding", &self.input_encoding) - .field("output_modes", &IdentList::new(self.labels(ModeGroup::Output))) - .field("output_encoding", &self.output_encoding) - .finish() + let mut debugger = f.debug_struct("Config"); + for group in ModeGroup::all() { + debugger.field(group.name(), &IdentList::new(self.labels(group))); + if group == ModeGroup::Input { + debugger.field("input_encoding", &self.input_encoding) + } else { + debugger.field("output_encoding", &self.output_encoding) + } + } + debugger.finish() } }