feat: functionality to open a sandbox workspace in vs code

This commit is contained in:
2026-10-22 18:59:15 +02:00
parent 230927d8db
commit 1ac5193b0e
12 changed files with 426 additions and 18 deletions
+2
View File
@@ -97,6 +97,8 @@ pub fn run(h: &Path, o: Opts, image: &str, cmd: Vec<String>, extra: &[String], g
.unwrap_or("/".into());
let mut s = String::from("B=/.wsbx/busybox\n");
s += &format!("$B date -s @{} >/dev/null\n", now());
// Some images ship no /etc/hosts: without a localhost entry, Go and others resolve it via DNS and fail.
s += "$B grep -qw localhost /etc/hosts 2>/dev/null || printf '127.0.0.1 localhost\\n::1 localhost\\n' >> /etc/hosts\n";
s += &format!("$B hostname {name}; echo {name} > /etc/hostname; $B grep -q ' {name}$' /etc/hosts 2>/dev/null || echo '127.0.1.1 {name}' >> /etc/hosts\n");
if let Some((rows, cols)) = term_size() {
s += &format!("$B stty rows {rows} cols {cols}\n");