wip: in-progress changes (grid, config, wizard, settings, pty) before session-persistence

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-15 15:28:19 +07:00
parent e37faf49d3
commit 4419f5660e
18 changed files with 365 additions and 42 deletions
+12 -1
View File
@@ -241,7 +241,7 @@ fn err(id: u64, code: &str, msg: &str) -> Envelope {
/// Compute spawn env (hooks for claude agents, zsh integration for zsh shells)
/// and whether a deterministic hook source is active.
fn spawn_env(sid: &SurfaceId, spec: &spacesh_proto::workspace::SurfaceSpec) -> (Vec<(String, String)>, bool) {
if crate::hooks::is_agent(&spec.command, spec.agent_label.as_deref()) {
let (mut env, active) = if crate::hooks::is_agent(&spec.command, spec.agent_label.as_deref()) {
let env = crate::hooks::prepare(sid, &crate::hooks::spacesh_bin());
let active = !env.is_empty();
(env, active)
@@ -249,7 +249,13 @@ fn spawn_env(sid: &SurfaceId, spec: &spacesh_proto::workspace::SurfaceSpec) -> (
(crate::hooks::shell_env(sid), false)
} else {
(vec![], false)
};
// Ensure the child sees the user's full PATH; the GUI/launchd-launched daemon
// otherwise can't find agents (claude/codex/gemini) and the panel exits at once.
if !env.iter().any(|(k, _)| k == "PATH") {
env.push(("PATH".to_string(), crate::config::enriched_path()));
}
(env, active)
}
/// Emit a `layout_changed` event for a workspace's current tree.
@@ -628,6 +634,11 @@ async fn handle_request(
}))).await;
}
Cmd::WhichAgents { candidates } => {
let available: Vec<String> = candidates.into_iter().filter(|c| crate::config::is_installed(c)).collect();
let _ = out.send(ok(id, serde_json::json!({ "available": available }))).await;
}
Cmd::Status => {
let (groups, workspaces) = reg.status();
let _ = out.send(ok(id, serde_json::json!({ "groups": groups, "workspaces": workspaces }))).await;