Function find

Source
pub fn find() -> Option<(String, u32)>
Expand description

Traverses up the parent processes to see if the name of any of them matches a KNOWN_SHELL

Examples found in repository?
examples/what_shell.rs (line 3)
1fn main() {
2    // `find` returns the name of the shell in a string and the pid as a u32
3    let (sh, pid) = pshell::find().unwrap_or(("unknown".to_string(), 0));
4    println!(
5        "This application has been run from pid `{}`, which is a {} shell",
6        pid, sh
7    );
8}