@@ -107,8 +107,8 @@ CODEX_HINT_PATH="/etc/profile.d/zz-codex-resume.sh"
107107if [[ ! -s "$CODEX_HINT_PATH" ]]; then
108108 cat <<'EOF' > "$CODEX_HINT_PATH"
109109docker_git_workspace_context_line() {
110- REPO_REF_VALUE="\${REPO_REF:-}"
111- REPO_URL_VALUE="\${REPO_URL:-}"
110+ REPO_REF_VALUE="\${REPO_REF:-__REPO_REF_DEFAULT__ }"
111+ REPO_URL_VALUE="\${REPO_URL:-__REPO_URL_DEFAULT__ }"
112112
113113 if [[ "$REPO_REF_VALUE" == issue-* ]]; then
114114 ISSUE_ID_VALUE="$(printf "%s" "$REPO_REF_VALUE" | sed -E 's#^issue-##')"
@@ -184,7 +184,20 @@ if [[ -s /etc/zsh/zshrc ]] && ! grep -q "zz-codex-resume.sh" /etc/zsh/zshrc 2>/d
184184 printf "%s\\n" "if [ -f /etc/profile.d/zz-codex-resume.sh ]; then source /etc/profile.d/zz-codex-resume.sh; fi" >> /etc/zsh/zshrc
185185fi`
186186
187- export const renderEntrypointCodexResumeHint = ( ) : string => entrypointCodexResumeHintTemplate
187+ const escapeForDoubleQuotes = ( value : string ) : string => {
188+ const backslash = String . fromCodePoint ( 92 )
189+ const quote = String . fromCodePoint ( 34 )
190+ const escapedBackslash = `${ backslash } ${ backslash } `
191+ const escapedQuote = `${ backslash } ${ quote } `
192+ return value
193+ . replaceAll ( backslash , escapedBackslash )
194+ . replaceAll ( quote , escapedQuote )
195+ }
196+
197+ export const renderEntrypointCodexResumeHint = ( config : TemplateConfig ) : string =>
198+ entrypointCodexResumeHintTemplate
199+ . replaceAll ( "__REPO_REF_DEFAULT__" , escapeForDoubleQuotes ( config . repoRef ) )
200+ . replaceAll ( "__REPO_URL_DEFAULT__" , escapeForDoubleQuotes ( config . repoUrl ) )
188201
189202const entrypointAgentsNoticeTemplate = String . raw `# Ensure global AGENTS.md exists for container context
190203AGENTS_PATH="__CODEX_HOME__/AGENTS.md"
0 commit comments