From 5f8ec49fe85e474fde3422f86d1e851d93d2d98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabor=20K=C3=B6rber?= Date: Tue, 22 Sep 2026 11:15:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=B0=EF=B8=8F=20export=20from=20upstrea?= =?UTF-8?q?m=20(b301c15)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/sandcage/src/docker.rs | 11 +++++++++++ crates/sandcage/src/init.rs | 3 +++ 2 files changed, 14 insertions(+) diff --git a/crates/sandcage/src/docker.rs b/crates/sandcage/src/docker.rs index d011d9b..40a6fb2 100644 --- a/crates/sandcage/src/docker.rs +++ b/crates/sandcage/src/docker.rs @@ -291,6 +291,7 @@ pub fn resolve_agent_home(sandcage_home: &Path, profile: Option<&str>) -> PathBu eprintln!("sandcage: warning: failed to create home profile '{name}': {e}"); } else { eprintln!("sandcage: created home profile '{name}'"); + seed_zshrc(&agent_home); } } @@ -301,6 +302,16 @@ pub fn resolve_agent_home(sandcage_home: &Path, profile: Option<&str>) -> PathBu agent_home } +pub fn seed_zshrc(agent_home: &Path) { + let zshrc = agent_home.join(".zshrc"); + if !zshrc.exists() { + let _ = std::fs::write(&zshrc, concat!( + "PROMPT='%F{blue}%~%f %# '\n", + "alias ls='ls --color=auto'\n", + )); + } +} + fn migrate_legacy_home(legacy: &Path, homes_dir: &Path) -> std::result::Result<(), std::io::Error> { let default_dir = homes_dir.join("default"); std::fs::create_dir_all(homes_dir)?; diff --git a/crates/sandcage/src/init.rs b/crates/sandcage/src/init.rs index 32f9bbd..17729c8 100644 --- a/crates/sandcage/src/init.rs +++ b/crates/sandcage/src/init.rs @@ -77,6 +77,9 @@ pub fn preseed_with_home(home: &Path) -> Result<()> { .map_err(|e| InitError::WriteFileFailed(justfile.clone(), e))?; } + // 7. Seed .zshrc to suppress zsh-newuser-install wizard + crate::docker::seed_zshrc(&agent_home); + Ok(()) }