diff --git a/src/meta_plugin/system.rs b/src/meta_plugin/system.rs index 689b564..5692b25 100644 --- a/src/meta_plugin/system.rs +++ b/src/meta_plugin/system.rs @@ -359,42 +359,3 @@ impl MetaPlugin for FullHostnameMetaPlugin { } } -#[derive(Debug, Clone, Default)] -pub struct TtyMetaPlugin { - meta_name: String, -} - -impl TtyMetaPlugin { - pub fn new() -> TtyMetaPlugin { - TtyMetaPlugin { - meta_name: "tty".to_string(), - } - } -} - -impl MetaPlugin for TtyMetaPlugin { - fn create(&self) -> Result> { - Ok(Box::new(io::sink())) - } - - fn finalize(&mut self) -> io::Result { - // Use isatty::tty_path to get the current TTY path - match isatty::stdout_isatty() { - true => { - match isatty::tty_path() { - Ok(path) => Ok(path.to_string_lossy().to_string()), - Err(_) => Ok("unknown tty".to_string()), - } - }, - false => Ok("not a tty".to_string()), - } - } - - fn update(&mut self, _data: &[u8]) { - // No update needed for TTY - } - - fn meta_name(&mut self) -> String { - self.meta_name.clone() - } -}