You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[bug] HOSTNAME is hardcoded to localhost instead of the machine's real host name #1139
[bug] HOSTNAME is hardcoded to localhost instead of the machine's real host name
echo$HOSTNAME# on this machine (hostname / /etc/hostname: htch-runtime)# GNU bash 5.3.20: htch-runtime# rubash / niu: localhost (always, regardless of the actual host name)
Expected (GNU bash 5.3.20): HOSTNAME is the real host name at startup.
Actual (rubash): a constant localhost.
Scripts that branch on $HOSTNAME (per-host configuration, logging, prompt info) silently behave as if every machine were the same host.
Env: rubash master 493ebb2 / niubash 1.4.4 (niu, master 953f513, embeds rubash 493ebb2), Linux x86_64, GNU bash 5.3.20 x86_64-pc-linux-gnu as oracle. Also reproduces in niu (same engine).
FIXED-BY-#1181 — verified on master (263ce53f). Commit 1b8ada5.
echo $HOSTNAME → DESKTOP-FDUJ7TN (real host name, via COMPUTERNAME fallback on Windows; uname on unix). Matches GNU.
Residual edge: under a fully empty environment (env -i, no COMPUTERNAME/HOSTNAME) Windows still falls back to localhost — the gethostname call is #[cfg(unix)]-gated. Tracking that startup-gap tail under #1129.
Activity
caomengxuan666 commentedon Oct 23, 2026
FIXED-BY-#1181 — verified on master (263ce53f). Commit 1b8ada5.
echo $HOSTNAME→DESKTOP-FDUJ7TN(real host name, via COMPUTERNAME fallback on Windows; uname on unix). Matches GNU.Residual edge: under a fully empty environment (
env -i, no COMPUTERNAME/HOSTNAME) Windows still falls back tolocalhost— the gethostname call is#[cfg(unix)]-gated. Tracking that startup-gap tail under #1129.