From edd1153c6448cf11f35787a74b719662f84a6ab9 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 10 Jul 2026 14:20:44 +0200 Subject: [PATCH] Fix persistent Claude terminal shell startup --- .../rootfs/usr/local/bin/claude-terminal-shell | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/claude_desktop/rootfs/usr/local/bin/claude-terminal-shell b/claude_desktop/rootfs/usr/local/bin/claude-terminal-shell index fed12dcd7f..daf449397e 100644 --- a/claude_desktop/rootfs/usr/local/bin/claude-terminal-shell +++ b/claude_desktop/rootfs/usr/local/bin/claude-terminal-shell @@ -1,15 +1,24 @@ #!/usr/bin/env bash set -euo pipefail -export HOME="${HOME:-/data/data}" +if [ -z "${HOME:-}" ]; then + echo "Claude terminal: HOME is not initialized." >&2 + exit 1 +fi + +export SHELL="/bin/bash" export PATH="${HOME}/.local/bin:/usr/local/bin:/usr/bin:/bin:${PATH:-}" workspace="${CLAUDE_TERMINAL_WORKSPACE:-${HOME}/workspace}" session_name="${CLAUDE_TMUX_SESSION:-claude}" -mkdir -p "$workspace" -cd "$workspace" +if [ ! -d "$workspace" ]; then + echo "Claude terminal: workspace does not exist: $workspace" >&2 + exit 1 +fi + +cd -- "$workspace" # Reattach every browser connection to the same terminal session. Closing the browser detaches # the client but leaves Claude Code and other commands running inside tmux. -exec tmux new-session -A -s "$session_name" +exec tmux new-session -A -s "$session_name" -c "$workspace"