From c94a97ae494a6c791adb582fb5ce1c65f834d9af Mon Sep 17 00:00:00 2001 From: gursewak1997 Date: Wed, 29 Apr 2026 12:58:54 -0700 Subject: [PATCH] ephemeral run: Print hint when running in foreground When running without -d, print a helpful hint explaining how to connect via SSH or view console output, avoiding confusion about the command appearing to hang. Signed-off-by: gursewak1997 --- crates/kit/src/run_ephemeral.rs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/crates/kit/src/run_ephemeral.rs b/crates/kit/src/run_ephemeral.rs index b98ce9a..0d0fdf3 100644 --- a/crates/kit/src/run_ephemeral.rs +++ b/crates/kit/src/run_ephemeral.rs @@ -88,7 +88,7 @@ //! - Ensures perfect fidelity of user options across process boundaries use std::fs::File; -use std::io::{BufWriter, Seek, Write}; +use std::io::{BufWriter, IsTerminal, Seek, Write}; use std::os::unix::process::CommandExt; use std::process::{Command, Stdio}; @@ -404,6 +404,18 @@ pub fn run_detached(opts: RunEphemeralOpts) -> Result { /// Launch privileged container with QEMU+KVM for ephemeral VM. pub fn run(opts: RunEphemeralOpts) -> Result<()> { + // Print helpful hint when running in foreground mode without console + if !opts.podman.detach && !opts.common.console && std::io::stderr().is_terminal() { + if let Some(name) = &opts.podman.name { + eprintln!( + "Hint: Use 'bcvk ephemeral ssh {}' to connect, or add --console to see VM output", + name + ); + } else { + eprintln!("Hint: Add --console to see VM output, or use -d for background mode"); + } + } + let (mut cmd, _temp_dir) = prepare_run_command_with_temp(opts)?; // Keep _temp_dir alive until exec replaces our process // At this point our process is replaced by `podman`, we are just a wrapper for creating