From 3d7bf7da2d9371dde3053efc5b376f9664ece3ea Mon Sep 17 00:00:00 2001 From: Bruce Ashfield Date: Thu, 8 Jan 2026 19:34:19 +0000 Subject: vcontainer: fix ps -q to suppress port forward display When using `ps -q` or `ps --quiet`, only container IDs should be output. The port forward registry display was being included, which broke cleanup code that expected just container IDs. Signed-off-by: Bruce Ashfield --- recipes-containers/vcontainer/files/vcontainer-common.sh | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'recipes-containers/vcontainer') diff --git a/recipes-containers/vcontainer/files/vcontainer-common.sh b/recipes-containers/vcontainer/files/vcontainer-common.sh index 9003e0c7..b0623164 100755 --- a/recipes-containers/vcontainer/files/vcontainer-common.sh +++ b/recipes-containers/vcontainer/files/vcontainer-common.sh @@ -1333,7 +1333,15 @@ case "$COMMAND" in PS_EXIT=$? # Show host port forwards if daemon is running and we have any - if daemon_is_running; then + # Skip if -q/--quiet flag is present (only container IDs requested) + PS_QUIET=false + for arg in "${COMMAND_ARGS[@]}"; do + case "$arg" in + -q|--quiet) PS_QUIET=true; break ;; + esac + done + + if [ "$PS_QUIET" = "false" ] && daemon_is_running; then pf_file=$(get_port_forward_file) if [ -f "$pf_file" ] && [ -s "$pf_file" ]; then echo "" -- cgit v1.2.3-54-g00ecf