Skip to content

fix: respect quotes/backslashes in prompt hooks - #449

Merged
ethanpailes merged 1 commit into
shell-pool:masterfrom
GeoffChurch:fix/prompt-hook-quoting
Nov 5, 2026
Merged

ethanpailes merged 1 commit into
shell-pool:masterfrom
GeoffChurch:fix/prompt-hook-quoting

Conversation

@GeoffChurch

Copy link
Copy Markdown
Contributor

Issue Link

#437

AI Policy Ack

ack

Vibe-coded

This PR was:

  • mostly or completely vibe coded
  • mostly or completely meat coded
  • bit of both

Description

Fedora's default PROMPT_COMMAND sets the terminal title with printf and arguments with quotes/backslashes. In prompt.bash, shpool ends up parsing the hook text twice, leading to garbled and possibly harmful results when eval'd.

Escaping the $ (\"${prompt_hook}\"" -> \"\${prompt_hook}\"") leaves expansion to the inner eval.

To pin the corrected handling, the test's PROMPT_COMMAND is now a printf with quotes and \n.

@ethanpailes
ethanpailes merged commit c87ae74 into shell-pool:master Nov 5, 2026
12 checks passed
This was referenced Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants