forked from extern/nushell
fixes process path being truncated (#885)
This commit is contained in:
parent
65ae3160ca
commit
dc6f1c496b
@ -303,12 +303,13 @@ impl ProcessInfo {
|
|||||||
|
|
||||||
/// Name of command
|
/// Name of command
|
||||||
pub fn name(&self) -> String {
|
pub fn name(&self) -> String {
|
||||||
self.command()
|
// self.command()
|
||||||
.split(' ')
|
// .split(' ')
|
||||||
.collect::<Vec<_>>()
|
// .collect::<Vec<_>>()
|
||||||
.first()
|
// .first()
|
||||||
.map(|x| x.to_string())
|
// .map(|x| x.to_string())
|
||||||
.unwrap_or_default()
|
// .unwrap_or_default()
|
||||||
|
self.command_only()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Full name of command, with arguments
|
/// Full name of command, with arguments
|
||||||
@ -335,6 +336,19 @@ impl ProcessInfo {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Full name of comand only
|
||||||
|
pub fn command_only(&self) -> String {
|
||||||
|
if let Some(path) = &self.curr_path {
|
||||||
|
if !path.cmd.is_empty() {
|
||||||
|
path.exe.to_string_lossy().to_string()
|
||||||
|
} else {
|
||||||
|
String::from("")
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
String::from("")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Get the status of the process
|
/// Get the status of the process
|
||||||
pub fn status(&self) -> String {
|
pub fn status(&self) -> String {
|
||||||
let mut state = 7;
|
let mut state = 7;
|
||||||
|
Loading…
Reference in New Issue
Block a user