From 88aa25f83a0cb7af56904743ba71b4f7562cffd5 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 15 Jun 2026 23:06:28 +0000 Subject: [PATCH 1/2] Add global bash PATH config to mirror fish shell Fish is the default Hypercube shell and sets up the user PATH (~/.local/bin, ~/.cargo/bin, ~/go/bin, ~/.npm-packages/bin) in /etc/fish/config.fish. Bash and other POSIX shells never read that config, so anything launched from them inherited a stripped-down PATH. This broke the ai-dev 'claude'/'agy' wrapper scripts in ~/.local/bin: they exec 'podman', which was not resolvable on the bash PATH. Add /etc/profile.d/hypercube-path.sh, which mirrors the fish PATH additions (and sources ~/.cargo/env when present) for sh/bash login and interactive shells. Also assert the file's presence in the build tests. --- build_files/hypercube/99-tests.sh | 1 + .../shared/etc/profile.d/hypercube-path.sh | 32 +++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 system_files/shared/etc/profile.d/hypercube-path.sh diff --git a/build_files/hypercube/99-tests.sh b/build_files/hypercube/99-tests.sh index 7ad8c11..df5dd7c 100755 --- a/build_files/hypercube/99-tests.sh +++ b/build_files/hypercube/99-tests.sh @@ -47,6 +47,7 @@ REQUIRED_FILES=( "/etc/greetd/config.toml" # Config files "/etc/fish/config.fish" + "/etc/profile.d/hypercube-path.sh" "/usr/share/hypercube/config/starship/starship.toml" # Theming "/usr/share/themes/Tokyonight-Dark/gtk-3.0/gtk.css" diff --git a/system_files/shared/etc/profile.d/hypercube-path.sh b/system_files/shared/etc/profile.d/hypercube-path.sh new file mode 100644 index 0000000..390078a --- /dev/null +++ b/system_files/shared/etc/profile.d/hypercube-path.sh @@ -0,0 +1,32 @@ +# Hypercube bash/sh PATH setup +# +# Fish is the default Hypercube shell and configures the user PATH in +# /etc/fish/config.fish (~/.local/bin, ~/.cargo/bin, etc). Bash and other +# POSIX shells don't read that config, so anything launched from them — such +# as the `claude`/`agy` wrapper scripts in ~/.local/bin, which exec `podman` +# — ended up with a stripped-down PATH and could not find those tools. +# +# This file mirrors the fish PATH additions for sh/bash so both shells resolve +# the same locations. It is sourced by login shells via /etc/profile and by +# interactive non-login shells via /etc/bashrc (Fedora sources /etc/profile.d/*). + +# Prepend a directory to PATH only if it exists and isn't already present. +__hypercube_add_path() { + case ":${PATH}:" in + *":$1:"*) ;; + *) [ -d "$1" ] && PATH="$1:${PATH}" ;; + esac +} + +__hypercube_add_path "$HOME/go/bin" +__hypercube_add_path "$HOME/.cargo/bin" +__hypercube_add_path "$HOME/.npm-packages/bin" +__hypercube_add_path "$HOME/.local/bin" + +export PATH + +# Pick up cargo's environment (extra PATH/vars) when rustup is installed, +# matching dot_files/fish/conf.d/rustup.fish. +[ -f "$HOME/.cargo/env" ] && . "$HOME/.cargo/env" + +unset -f __hypercube_add_path From 530e281918b2c091366509f37d848709bdad6e76 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 15 Jun 2026 23:13:49 +0000 Subject: [PATCH 2/2] Guarantee default system dirs on bash PATH The real gap was the standard system directories (/usr/bin, /bin, /usr/sbin, etc.), not the per-user dirs. podman lives at /usr/bin/podman, so when a bash shell came up without /usr/bin on PATH the ai-dev 'claude'/'agy' wrappers could not exec it. Ensure the default system directories are always present (appended if an inherited PATH lacks them, sane even from an empty PATH), while still mirroring the fish per-user PATH additions. --- .../shared/etc/profile.d/hypercube-path.sh | 53 +++++++++++++------ 1 file changed, 38 insertions(+), 15 deletions(-) diff --git a/system_files/shared/etc/profile.d/hypercube-path.sh b/system_files/shared/etc/profile.d/hypercube-path.sh index 390078a..b9ed7a2 100644 --- a/system_files/shared/etc/profile.d/hypercube-path.sh +++ b/system_files/shared/etc/profile.d/hypercube-path.sh @@ -1,27 +1,50 @@ # Hypercube bash/sh PATH setup # -# Fish is the default Hypercube shell and configures the user PATH in -# /etc/fish/config.fish (~/.local/bin, ~/.cargo/bin, etc). Bash and other -# POSIX shells don't read that config, so anything launched from them — such -# as the `claude`/`agy` wrapper scripts in ~/.local/bin, which exec `podman` -# — ended up with a stripped-down PATH and could not find those tools. +# Fish is the default Hypercube shell. When bash (or another POSIX shell) is +# launched without inheriting a full PATH, it can come up missing the standard +# system directories — /usr/bin, /bin, /usr/sbin, /sbin, etc. That is where +# system tools like podman live (/usr/bin/podman), so the ai-dev `claude`/`agy` +# wrapper scripts in ~/.local/bin failed: they exec `podman`, which was not +# resolvable on a stripped-down bash PATH. # -# This file mirrors the fish PATH additions for sh/bash so both shells resolve -# the same locations. It is sourced by login shells via /etc/profile and by -# interactive non-login shells via /etc/bashrc (Fedora sources /etc/profile.d/*). +# This file guarantees the default system directories are on PATH for sh/bash, +# and also mirrors the user PATH additions from /etc/fish/config.fish so both +# shells resolve the same locations. It is sourced by login shells via +# /etc/profile and by interactive non-login shells via /etc/bashrc (Fedora +# sources /etc/profile.d/* in both cases). -# Prepend a directory to PATH only if it exists and isn't already present. -__hypercube_add_path() { +# Append a directory to PATH only if it isn't already present (used for the +# system dirs, which must always exist regardless of inheritance). +__hypercube_append_path() { + case ":${PATH}:" in + *":$1:"*) ;; + *) PATH="${PATH:+$PATH:}$1" ;; + esac +} + +# Prepend a directory to PATH only if it exists and isn't already present +# (used for the per-user dirs, which may not exist yet). +__hypercube_prepend_path() { case ":${PATH}:" in *":$1:"*) ;; *) [ -d "$1" ] && PATH="$1:${PATH}" ;; esac } -__hypercube_add_path "$HOME/go/bin" -__hypercube_add_path "$HOME/.cargo/bin" -__hypercube_add_path "$HOME/.npm-packages/bin" -__hypercube_add_path "$HOME/.local/bin" +# Default system directories. Guaranteed present even if PATH was inherited +# empty or minimal (e.g. a non-interactive shell spawned from a service or GUI). +__hypercube_append_path "/usr/local/sbin" +__hypercube_append_path "/usr/local/bin" +__hypercube_append_path "/usr/sbin" +__hypercube_append_path "/usr/bin" +__hypercube_append_path "/sbin" +__hypercube_append_path "/bin" + +# Per-user directories, mirroring dot_files/fish/config.fish. +__hypercube_prepend_path "$HOME/go/bin" +__hypercube_prepend_path "$HOME/.cargo/bin" +__hypercube_prepend_path "$HOME/.npm-packages/bin" +__hypercube_prepend_path "$HOME/.local/bin" export PATH @@ -29,4 +52,4 @@ export PATH # matching dot_files/fish/conf.d/rustup.fish. [ -f "$HOME/.cargo/env" ] && . "$HOME/.cargo/env" -unset -f __hypercube_add_path +unset -f __hypercube_append_path __hypercube_prepend_path