-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use cmdline instead of comm, in terminal detection #130
base: main
Are you sure you want to change the base?
Conversation
@@ -404,35 +413,50 @@ impl GeneralReadout for LinuxGeneralReadout { | |||
} | |||
} | |||
|
|||
fn terminal_exec(pid: i32) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
terminal_name
seems more appropriate here.
|
||
let mut terminal_name = terminal_exec(terminal_pid); | ||
if terminal_name.is_empty() { | ||
return "".to_string(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use String::new()
instead?
// fn terminal(&self) -> Result<String, ReadoutError> { | ||
// use terminfo::Database; | ||
// | ||
// let db = Database::from_env() | ||
// let term = db.name(); | ||
// | ||
// Ok(term.to_string()) | ||
// } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove this commented function?
@@ -25,6 +25,7 @@ features = ["build","cargo","git","rustc"] | |||
dirs = "4.0" | |||
walkdir = "2.3.2" | |||
os-release = "0.1" | |||
terminfo = "0.7" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you forgot to remove this dependency.
fixes: Macchina-CLI/macchina#272
Doesn't work in nix-shells in my testing