From 1acbe93bc8e4997e35a4fa9f10e771c7f272db40 Mon Sep 17 00:00:00 2001 From: Chingis S Date: Fri, 4 Sep 2026 10:49:50 +0300 Subject: [PATCH] Fix shell prompt hostname Use the container runtime hostname in the shell prompt so Kubernetes hostname overrides are visible instead of reconstructing a stale app and environment label. Add a regression assertion for the generated prompt. --- 8/Dockerfile | 2 +- 8/tests/tests.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/8/Dockerfile b/8/Dockerfile index 2a8aab91..5f4e2fb0 100644 --- a/8/Dockerfile +++ b/8/Dockerfile @@ -368,7 +368,7 @@ RUN set -xe; \ mv /tmp/walter_linux_amd64/walter /usr/local/bin; \ \ { \ - echo 'export PS1="\u@${WODBY_APP_NAME:-php}.${WODBY_ENVIRONMENT_NAME:-container}:\w $ "'; \ + echo 'export PS1="\u@$(hostname):\w $ "'; \ # Make sure PATH is the same for ssh sessions. \ echo "export PATH=${PATH}"; \ } | tee /home/wodby/.shrc; \ diff --git a/8/tests/tests.sh b/8/tests/tests.sh index da764c54..7059dc50 100755 --- a/8/tests/tests.sh +++ b/8/tests/tests.sh @@ -6,6 +6,13 @@ if [[ -n "${DEBUG}" ]]; then set -x fi +source /home/wodby/.shrc +expected_prompt='\u@'"$(hostname)"':\w $ ' +if [[ "${PS1}" != "${expected_prompt}" ]]; then + echo "Unexpected shell prompt: ${PS1}" + exit 1 +fi + php -m > ~/php_modules.tmp echo -n "Checking PHP modules... "