Problem
The install script fails with exit code 1 when run inside a Docker RUN step (or any non-interactive CI environment) because it calls read -r answer </dev/tty for two interactive prompts:
- libsecret-tools prompt — shown when
secret-tool is not found on Linux
- Starship prompt — shown when
starship is not found
Docker BuildKit build steps have no controlling terminal, so opening /dev/tty returns No such device or address. Because the script uses set -euo pipefail, this kills the entire build.
Observed error (from VS Code Dev Containers log):
ERROR: failed to solve: process "/bin/sh -c curl -fsSL https://cship.dev/install.sh | bash" did not complete successfully: exit code: 1
Reproduction
FROM ubuntu:24.04
RUN curl -fsSL https://cship.dev/install.sh | bash
docker build .
# → exit code: 1
Suggested Fix
Guard each interactive prompt with a TTY check before attempting to read from /dev/tty:
if [ "$OS" = "Linux" ] && ! command -v secret-tool >/dev/null 2>&1; then
if { exec 3</dev/tty; } 2>/dev/null; then
exec 3<&-
printf "Install libsecret-tools? (required for usage limits on Linux) [Y/n] "
read -r answer </dev/tty
case "$answer" in
[Nn]*) echo "Skipping — usage limits module unavailable until installed manually." ;;
*) sudo apt-get install -y libsecret-tools ;;
esac
else
echo "Non-interactive mode: skipping libsecret-tools (install manually if needed)."
fi
fi
Same pattern for the Starship prompt. Alternatively, honour a CSHIP_NONINTERACTIVE=1 env var or check the common CI variable to auto-select defaults silently.
Workaround
Pre-install the dependencies before running the cship installer so the prompts are never reached:
RUN apt-get update && apt-get install -y libsecret-tools
RUN curl -sS https://starship.rs/install.sh | sh -s -- --yes
RUN curl -fsSL https://cship.dev/install.sh | bash
Problem
The install script fails with exit code 1 when run inside a Docker
RUNstep (or any non-interactive CI environment) because it callsread -r answer </dev/ttyfor two interactive prompts:secret-toolis not found on Linuxstarshipis not foundDocker BuildKit build steps have no controlling terminal, so opening
/dev/ttyreturnsNo such device or address. Because the script usesset -euo pipefail, this kills the entire build.Observed error (from VS Code Dev Containers log):
Reproduction
Suggested Fix
Guard each interactive prompt with a TTY check before attempting to read from
/dev/tty:Same pattern for the Starship prompt. Alternatively, honour a
CSHIP_NONINTERACTIVE=1env var or check the commonCIvariable to auto-select defaults silently.Workaround
Pre-install the dependencies before running the cship installer so the prompts are never reached: