Using --resume with --name should still accept session IDs (#4937)
thank you!
This commit is contained in:
@@ -75,7 +75,7 @@ async fn get_session_id(identifier: Identifier) -> Result<String> {
|
|||||||
|
|
||||||
sessions
|
sessions
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.find(|s| s.description == name)
|
.find(|s| s.id == name || s.description.contains(&name))
|
||||||
.map(|s| s.id)
|
.map(|s| s.id)
|
||||||
.ok_or_else(|| anyhow::anyhow!("No session found with name '{}'", name))
|
.ok_or_else(|| anyhow::anyhow!("No session found with name '{}'", name))
|
||||||
} else if let Some(path) = identifier.path {
|
} else if let Some(path) = identifier.path {
|
||||||
|
|||||||
@@ -758,6 +758,11 @@ impl CliSession {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(id) = &self.session_id {
|
||||||
|
println!("Closing session. Session ID: {}", console::style(id).cyan());
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -743,6 +743,14 @@ pub fn display_session_info(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(id) = session_id {
|
||||||
|
println!(
|
||||||
|
" {} {}",
|
||||||
|
style("session id:").dim(),
|
||||||
|
style(id).cyan().dim()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
println!(
|
println!(
|
||||||
" {} {}",
|
" {} {}",
|
||||||
style("working directory:").dim(),
|
style("working directory:").dim(),
|
||||||
|
|||||||
Reference in New Issue
Block a user