Skip to content

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

Closed

Description

@jparise

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'
Screenshot 2026-03-08 at 3 51 31 PM

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)
  • opam is the OCaml package manager
  • I fixed the issue by not including the ; when appending to PROMPT_COMMAND if it already ends in ;:
Screenshot 2026-03-08 at 4 28 08 PM

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 | delta

Expected 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'
Screenshot 2026-03-08 at 3 51 31 PM

Reproduction Steps

  1. On macOS, update to latest Ghostty: brew install --cask ghostty@tip
  2. Use bash as the default terminal
  3. Open a new Ghostty window
  4. 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 = bash

Additional 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.0

I 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.

Activity

  1. added theissue type on Mar 9, 2026
  2. added this to the 1.3.0 milestone on Mar 9, 2026
  3. added a commit that references this issue on Mar 9, 2026
    308b713
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions