sessions : am sessions --resume <id> (issue #32) - relance en arriere-plan avec les arguments et le cwd d'origine, cwd optionnel dans spawn_background, gardes running/repl/erreurs claires

This commit is contained in:
2026-08-17 08:48:30 -04:00
parent 314583ceee
commit 30cc49de3c
8 changed files with 96 additions and 12 deletions
+4
View File
@@ -98,6 +98,7 @@ pub fn spawn_background(
program: &Path,
args: &[String],
env: &BTreeMap<String, String>,
cwd: Option<&Path>,
) -> Result<u32> {
let log = agent_log_path(app, agent_name);
if app.dry_run() {
@@ -121,6 +122,9 @@ pub fn spawn_background(
.envs(env)
.stdout(Stdio::from(file.try_clone()?))
.stderr(Stdio::from(file));
if let Some(dir) = cwd {
cmd.current_dir(dir);
}
#[cfg(unix)]
{
use std::os::unix::process::CommandExt;