[GH-ISSUE #490] OpenCode in tmux starts with random hex codes and sometimes throws exception #895

Open
opened 2026-03-14 08:58:05 +03:00 by kerem · 1 comment
Owner

Originally created by @jtackaberry on GitHub (Jan 7, 2026).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/490

When I start opencode within tmux 3.6a, the prompt is initialized with random slash-delimited hex codes. Here are some example:

  • 2c2/3f3f7d7/cfcff7f7/8e8e9f9f/cfcfffff
  • 7d7/cfcfe6e/676
  • 0a0/0000e9e9/4f4fa6a6/e0e

This part is probably a tmux bug because it doesn't occur with 3.5a or 3.4 (although who can know for sure -- this area is minefield of alchemy that few understand) and I'll report it there, but occasionally the slew of characters causes an exception with opencode:

[12:09:25] [LOG] 'bootstrapping'
[12:09:25] [LOG] 'resolveSystemTheme'
[12:09:25] [LOG] '{"type":"home"}'
[12:09:25] [LOG] [
      '#2e3436', '#d43636',
      '#7fc23f', '#c4a000',
      '#5f90ce', '#bb75a2',
      '#44c6c8', null,
      '#555753', '#ff6e67',
      '#5af78e', '#fce94f',
      null,      '#e7a6e0',
      '#6eebeb', null
    ]
[12:09:25] [ERROR] Error: null is not an object (evaluating 'hex3.replace')
    TypeError: null is not an object (evaluating 'hex3.replace')
        at hexToRgb (../../node_modules/.bun/@opentui+core@0.1.69+81ecd8642a1892ca/node_modules/@opentui/core/index-zj0wwh9d.js:2553:9)
        at generateSystem (src/cli/cmd/tui/context/theme.tsx:323:19)
        at <anonymous> (src/cli/cmd/tui/context/theme.tsx:252:33)
        at <anonymous> (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/store/dist/dev.js:437:7)
        at updatePath (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/store/dist/dev.js:202:13)
        at <anonymous> (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/store/dist/dev.js:222:77)
        at runUpdates (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:849:17)
        at setStore (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/store/dist/dev.js:221:5)
        at <anonymous> (src/cli/cmd/tui/context/theme.tsx:251:9)
        at processTicksAndRejections (native:7:39)

The input I saw in the prompt box was:

7d7/cfcf9f9f/cfcfffff/ffff

Even assuming the root cause is a tmux issue, I suppose opentui should handle this more robustly.

Originally created by @jtackaberry on GitHub (Jan 7, 2026). Original GitHub issue: https://github.com/anomalyco/opentui/issues/490 When I start opencode within tmux 3.6a, the prompt is initialized with random slash-delimited hex codes. Here are some example: * 2c2/3f3f7d7/cfcff7f7/8e8e9f9f/cfcfffff * 7d7/cfcfe6e/676 * 0a0/0000e9e9/4f4fa6a6/e0e This part is probably a tmux bug because it doesn't occur with 3.5a or 3.4 (although who can know for sure -- this area is minefield of alchemy that few understand) and I'll report it there, but occasionally the slew of characters causes an exception with opencode: ``` [12:09:25] [LOG] 'bootstrapping' [12:09:25] [LOG] 'resolveSystemTheme' [12:09:25] [LOG] '{"type":"home"}' [12:09:25] [LOG] [ '#2e3436', '#d43636', '#7fc23f', '#c4a000', '#5f90ce', '#bb75a2', '#44c6c8', null, '#555753', '#ff6e67', '#5af78e', '#fce94f', null, '#e7a6e0', '#6eebeb', null ] [12:09:25] [ERROR] Error: null is not an object (evaluating 'hex3.replace') TypeError: null is not an object (evaluating 'hex3.replace') at hexToRgb (../../node_modules/.bun/@opentui+core@0.1.69+81ecd8642a1892ca/node_modules/@opentui/core/index-zj0wwh9d.js:2553:9) at generateSystem (src/cli/cmd/tui/context/theme.tsx:323:19) at <anonymous> (src/cli/cmd/tui/context/theme.tsx:252:33) at <anonymous> (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/store/dist/dev.js:437:7) at updatePath (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/store/dist/dev.js:202:13) at <anonymous> (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/store/dist/dev.js:222:77) at runUpdates (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/dist/dev.js:849:17) at setStore (../../node_modules/.bun/solid-js@1.9.10/node_modules/solid-js/store/dist/dev.js:221:5) at <anonymous> (src/cli/cmd/tui/context/theme.tsx:251:9) at processTicksAndRejections (native:7:39) ``` The input I saw in the prompt box was: 7d7/cfcf9f9f/cfcfffff/ffff Even assuming the root cause is a tmux issue, I suppose opentui should handle this more robustly.
Author
Owner

@jtackaberry commented on GitHub (Jan 7, 2026):

I opened https://github.com/tmux/tmux/issues/4793 and it does appear to be a tmux issue, but again I think opentui could probably stand to be a bit more defensive to avoid the exception.

<!-- gh-comment-id:3720387100 --> @jtackaberry commented on GitHub (Jan 7, 2026): I opened https://github.com/tmux/tmux/issues/4793 and it does appear to be a tmux issue, but again I think opentui could probably stand to be a bit more defensive to avoid the exception.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#895
No description provided.