Skip to content

bash: handle existing ; in PROMPT_COMMAND - #11260

Merged
mitchellh merged 1 commit into
ghostty-org:mainfrom
jparise:bash-promptcommand-semi
Mar 9, 2026
Merged

mitchellh merged 1 commit into
ghostty-org:mainfrom
jparise:bash-promptcommand-semi

Conversation

@jparise

@jparise jparise commented Mar 9, 2026

Copy link
Copy Markdown
Contributor

If an existing PROMPT_COMMAND was a string ending in ; (and maybe some spaces), we'd add a redundant ;, resulting in a syntax error. Now we strip any trailing ;[[:space:]]* characters from the original string before add ours.

Fixes #11259

If an existing PROMPT_COMMAND was a string ending in ; (and maybe some
spaces), we'd add a redundant ;, resulting in a syntax error. Now we
strip any trailing `;[[:space:]]*` characters from the original string
before add ours.
@jparise
jparise requested a review from a team as a code owner March 9, 2026 13:24
@mitchellh
mitchellh merged commit 308b713 into ghostty-org:main Mar 9, 2026
36 of 40 checks passed
@github-actions github-actions Bot added this to the 1.3.0 milestone Mar 9, 2026
@jparise
jparise deleted the bash-promptcommand-semi branch March 9, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

shell-integration: bash: PROMPT_COMMAND: line 0: syntax error near unexpected token ;;' when PROMPT_COMMAND already ends in ;

2 participants