Repository navigation
shell-integration: bash: PROMPT_COMMAND: line 0: syntax error near unexpected token ;;' when PROMPT_COMMAND already ends in ; #11259
Copy link
Copy link
Labels
Milestone
Description
Discussed in #11245
Originally posted by jmcgover March 8, 2026
Issue Description
Before every bash command after Ghostty commit 5425569, bash reports the following error:
bash: PROMPT_COMMAND: line 0: syntax error near unexpected token `;;'
bash: PROMPT_COMMAND: line 0: `_opam_env_hook;; __ghostty_hook'
Notes:
- It looks like 5425569 introduced this particular appending to
PROMPT_COMMAND GNU bash, version 5.3.9(1)-release (aarch64-apple-darwin24.6.0)opamis the OCaml package manager- I fixed the issue by not including the
;when appending toPROMPT_COMMANDif it already ends in;:
The diff command (for posterity):
diff -u \
<(curl https://raw.githubusercontent.com/ghostty-org/ghostty/2d347cad336b6d4bd461f33fe87d90e6aa269843/src/shell-integration/bash/ghostty.bash) \
${GHOSTTY_RESOURCES_DIR}/shell-integration/bash/ghostty.bash | deltaExpected Behavior
No PROMPT_COMMAND errors before any commands.
Actual Behavior
bash reports the following error before every command:
bash: PROMPT_COMMAND: line 0: syntax error near unexpected token `;;'
bash: PROMPT_COMMAND: line 0: `_opam_env_hook;; __ghostty_hook'
Reproduction Steps
- On macOS, update to latest Ghostty:
brew install --cask ghostty@tip - Use
bashas the default terminal - Open a new Ghostty window
- Observe error:
bash: PROMPT_COMMAND: line 0: syntax error near unexpected token `;;'
bash: PROMPT_COMMAND: line 0: `_opam_env_hook;; __ghostty_hook'Ghostty Logs
Filtering the log data using "subsystem == "com.mitchellh.ghostty""
Timestamp Thread Type Activity PID TTL
2026-03-08 15:53:12.149035-0700 0xa30e21 Info 0x1422e1e 19895 0 ghostty: [com.mitchellh.ghostty:ghostty] known but unimplemented action action=40
2026-03-08 15:53:12.154904-0700 0xa30e21 Info 0x1422e1e 19895 0 ghostty: [com.mitchellh.ghostty:io_exec] io_exec: found Ghostty resources dir: /Applications/Ghostty.app/Contents/Resources/ghostty
2026-03-08 15:53:12.155202-0700 0xa30e21 Info 0x1422e1e 19895 0 ghostty: [com.mitchellh.ghostty:io_exec] io_exec: shell integration automatically injected shell=.bash
2026-03-08 15:53:12.155461-0700 0xa30e21 Info 0x1422e1e 19895 0 ghostty: [com.mitchellh.ghostty:ghostty] known but unimplemented action action=22
2026-03-08 15:53:12.162913-0700 0xa3db18 Info 0x0 19895 0 ghostty: [com.mitchellh.ghostty:io_exec] io_exec: started subcommand path=/usr/bin/login pid=24265
2026-03-08 15:53:45.041284-0700 0xa38d0e Info 0x0 19895 0 ghostty: [com.mitchellh.ghostty:generic_renderer] generic_renderer: updating display link display id=1
2026-03-08 15:53:45.041422-0700 0xa34a9f Info 0x0 19895 0 ghostty: [com.mitchellh.ghostty:generic_renderer] generic_renderer: updating display link display id=1
2026-03-08 15:53:45.041733-0700 0xa3b384 Info 0x0 19895 0 ghostty: [com.mitchellh.ghostty:generic_renderer] generic_renderer: updating display link display id=1
2026-03-08 15:53:45.042327-0700 0xa3ce34 Info 0x0 19895 0 ghostty: [com.mitchellh.ghostty:generic_renderer] generic_renderer: updating display link display id=1
2026-03-08 15:53:45.042442-0700 0xa3db17 Info 0x0 19895 0 ghostty: [com.mitchellh.ghostty:generic_renderer] generic_renderer: updating display link display id=1
2026-03-08 15:53:45.042617-0700 0xa3d5e8 Info 0x0 19895 0 ghostty: [com.mitchellh.ghostty:generic_renderer] generic_renderer: updating display link display id=1
2026-03-08 15:53:45.049916-0700 0xa38d0e Info 0x0 19895 0 ghostty: [com.mitchellh.ghostty:generic_renderer] generic_renderer: updating display link display id=1
2026-03-08 15:53:45.050239-0700 0xa34a9f Info 0x0 19895 0 ghostty: [com.mitchellh.ghostty:generic_renderer] generic_renderer: updating display link display id=1
2026-03-08 15:53:45.050447-0700 0xa3b384 Info 0x0 19895 0 ghostty: [com.mitchellh.ghostty:generic_renderer] generic_renderer: updating display link display id=1
Ghostty Version
Ghostty 1.3.0-main+861a9cf53
Version
- version: 1.3.0-main+861a9cf53
- channel: tip
Build Config
- Zig version : 0.15.2
- build mode : .ReleaseFast
- app runtime : .none
- font engine : .coretext
- renderer : renderer.generic.Renderer(renderer.Metal)
- libxev : kqueue
OS Version Information
macOS Sequoia 15.7.4 (24G517) arm64
(Linux only) Display Server
None
(Linux only) Desktop Environment/Window Manager
No response
Minimal Ghostty Configuration
shell-integration = bashAdditional Relevant Configuration
bash
$ bash --version
GNU bash, version 5.3.9(1)-release (aarch64-apple-darwin24.6.0)
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.opam: OCaml Package Manager
$ opam --version
2.5.0I acknowledge that:
- I have reviewed the FAQ and confirm that my issue is NOT among them.
- I have searched the Ghostty repository (both open and closed Discussions and Issues) and confirm this is not a duplicate of an existing issue or discussion.
- I have checked the "Preview" tab on all text fields to ensure that everything looks right, and have wrapped all configuration and code in code blocks with a group of three backticks (
```) on separate lines.
Reactions are currently unavailable
Activity
bash: handle existing ; in PROMPT_COMMAND (ghostty-org#11260)