Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yavko
Copy link

@yavko yavko commented Jan 24, 2023

fixes: Macchina-CLI/macchina#272
Doesn't work in nix-shells in my testing

@@ -404,35 +413,50 @@ impl GeneralReadout for LinuxGeneralReadout {
}
}

fn terminal_exec(pid: i32) -> String {
Copy link
Member

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();
Copy link
Member

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?

Comment on lines +382 to +390
// fn terminal(&self) -> Result<String, ReadoutError> {
// use terminfo::Database;
//
// let db = Database::from_env()
// let term = db.name();
//
// Ok(term.to_string())
// }

Copy link
Member

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"
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Terminal has weird name on NixOS with home-manager
2 participants