Skip to content

opencode doesn't read tui.json #26040

Closed
Closed

Description

@bavarianbidi

Description

According to the documentation i've placed a custom tui.json under $HOME/.config/opencode.

tui.json looks like the following:

{
  "$schema": "https://opencode.ai/tui.json",
  "keybinds": {
    "input_line_home": "ctrl+r",
    "input_newline": "shift+return,ctrl+return"
  }
}

But opencode never tries to read this file (see strace output below).

My opencode-version:

cd <project-root-folder>
strace -o /tmp/opencode-strace.txt opencode

all "open file" calls (via grep openat /tmp/opencode-strace.txt)

openat(AT_FDCWD, "/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/proc/self/maps", O_RDONLY|O_CLOEXEC) = 3
openat(AT_FDCWD, "/proc/sys/vm/mmap_min_addr", O_RDONLY) = 3
openat(AT_FDCWD, "/dev/urandom", O_RDONLY) = 3
openat(AT_FDCWD, "/proc/self/maps", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/proc/self/cgroup", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/sys/fs/cgroup/user.slice/user-1654579958.slice/session-3.scope/cpu.max", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/sys/fs/cgroup/user.slice/user-1654579958.slice/cpu.max", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/sys/fs/cgroup/user.slice/cpu.max", O_RDONLY|O_CLOEXEC) = 4
openat(AT_FDCWD, "/sys/fs/cgroup/cpu.max", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/sys/kernel/debug/tracing/trace_marker", O_WRONLY) = -1 EACCES (Permission denied)
openat(AT_FDCWD, "/etc/localtime", O_RDONLY|O_CLOEXEC) = 7
openat(AT_FDCWD, "/dev/urandom", O_RDONLY) = 9
openat(AT_FDCWD, "/proc/self/cgroup", O_RDONLY|O_CLOEXEC) = 10
openat(AT_FDCWD, "/sys/fs/cgroup/user.slice/user-1654579958.slice/session-3.scope/memory.max", O_RDONLY|O_CLOEXEC) = 10
openat(AT_FDCWD, "/sys/fs/cgroup/user.slice/user-1654579958.slice/session-3.scope/memory.high", O_RDONLY|O_CLOEXEC) = 10
openat(AT_FDCWD, "/sys/fs/cgroup/user.slice/user-1654579958.slice/memory.max", O_RDONLY|O_CLOEXEC) = 10
openat(AT_FDCWD, "/sys/fs/cgroup/user.slice/user-1654579958.slice/memory.high", O_RDONLY|O_CLOEXEC) = 10
openat(AT_FDCWD, "/sys/fs/cgroup/user.slice/memory.max", O_RDONLY|O_CLOEXEC) = 10
openat(AT_FDCWD, "/sys/fs/cgroup/user.slice/memory.high", O_RDONLY|O_CLOEXEC) = 10
openat(AT_FDCWD, "/sys/fs/cgroup/memory.max", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/sys/fs/cgroup/memory.high", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/proc/self/statm", O_RDONLY|O_CLOEXEC) = 10
openat(AT_FDCWD, "/proc/self/maps", O_RDONLY|O_CLOEXEC) = 11
openat(AT_FDCWD, "/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 12
openat(AT_FDCWD, "/$bunfs/root/src/index.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/tmp", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 13
openat(13, ".f9effff75bdb77bf-00000000.so", O_WRONLY|O_CREAT|O_CLOEXEC, 0644) = 14
openat(AT_FDCWD, "/tmp/.f9effff75bdb77bf-00000000.so", O_RDONLY|O_CLOEXEC) = 14
openat(AT_FDCWD, "/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 14
openat(AT_FDCWD, "/home/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 15
openat(AT_FDCWD, "/home/comario/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 16
openat(16, "package.json", O_RDONLY)    = 17
openat(AT_FDCWD, "/home/comario/go/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 17
openat(AT_FDCWD, "/home/comario/go/src/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 18
openat(AT_FDCWD, "/home/comario/go/src/git.company.com/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 19

openat(AT_FDCWD, "/home/comario/go/src/git.company.com/my-git-org/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 21
openat(AT_FDCWD, "/home/comario/go/src/git.company.com/my-git-org/my-git-project", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 22
openat(AT_FDCWD, "/home/comario/node_modules/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = 14
openat(AT_FDCWD, "/home/comario/node_modules/node-gyp", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/node_modules/node-gyp/bin", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/node_modules/node-gyp/bin/", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/node_modules/esprima", O_RDONLY|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/proc/version", O_RDONLY|O_NOCTTY) = 14
openat(AT_FDCWD, "/home/comario/.local/share/opencode/auth.json", O_RDONLY|O_NOCTTY) = 14
openat(AT_FDCWD, "/home/comario/go/src/git.company.com/my-git-org/my-git-projectr", O_RDONLY|O_DIRECTORY) = 14
openat(AT_FDCWD, "/home/comario/go/src/git.company.com/my-git-org", O_RDONLY|O_DIRECTORY) = 14
openat(AT_FDCWD, "/home/comario/go/src/git.company.com", O_RDONLY|O_DIRECTORY) = 14
openat(AT_FDCWD, "/home/comario/go/src", O_RDONLY|O_DIRECTORY) = 14
openat(AT_FDCWD, "/home/comario/go", O_RDONLY|O_DIRECTORY) = 14
openat(AT_FDCWD, "/home/comario", O_RDONLY|O_DIRECTORY) = 14
openat(AT_FDCWD, "/home/comario/package.json", O_RDONLY|O_NOCTTY) = 14
openat(AT_FDCWD, "/$bunfs/locales/en_US.json", O_RDONLY|O_NOCTTY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/go/src/git.company.com/my-git-org/my-git-project", O_RDONLY|O_PATH) = 14
openat(AT_FDCWD, "/home/comario/go/src/git.company.com/my-git-org/my-git-project", O_RDONLY|O_PATH) = 14
openat(AT_FDCWD, "/home/comario/go/src/git.company.com/my-git-org/my-git-project", O_RDONLY|O_PATH) = 14
openat(AT_FDCWD, "/dev/pts/1", O_RDONLY|O_NOCTTY|O_NONBLOCK|O_CLOEXEC) = 20
openat(AT_FDCWD, "/$bunfs/root/chunk-jfbp5vw0.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/.claude/ide", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-3g8y5kyc.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-d7a7m5qh.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-yyketgcf.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-4r43j9j9.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-pm5a9fwv.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-frnks4ag.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-j6z3z1w4.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-pymyh31b.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-8354xddf.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-txda66e4.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-p4j1ve8s.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-wzwzbm9t.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-h6byr4qe.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-0y7gwm8m.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-b9cb6xp4.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-rs1nk43n.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-bkcwrwac.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-kf1spxhy.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-s5qkzgvk.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-2gxe6th8.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-w7ehg0hg.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-812qsrfz.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-4ea4cgrk.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-yaw6dxay.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-drmjbd7x.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/go/src/git.company.com/my-git-org/my-git-project", O_RDONLY|O_PATH) = 36
openat(AT_FDCWD, "/home/comario/.local/share/opencode/opencode.db", O_RDWR|O_CREAT|O_NOFOLLOW|O_CLOEXEC, 0644) = 36
openat(AT_FDCWD, "/home/comario/.local/share/opencode/opencode.db-wal", O_RDWR|O_CREAT|O_NOFOLLOW|O_CLOEXEC, 0644) = 37
openat(AT_FDCWD, "/home/comario/.local/share/opencode", O_RDONLY|O_CLOEXEC) = 39
openat(AT_FDCWD, "/$bunfs/root/chunk-3kjjg7ad.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-89wexvsw.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-bzaxp1bm.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-1sh3asex.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-5xybpzfg.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-t4chn0yw.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-dfv8tkr4.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-9hhz25wg.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-6y73f66b.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-p7fsrbnf.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-edw3jsf7.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/$bunfs/root/chunk-dta9m0ch.js", O_RDONLY|O_PATH) = -1 ENOENT (No such file or directory)
openat(13, ".5effffd7fdd7ffeb-00000002.node", O_WRONLY|O_CREAT|O_CLOEXEC, 0644) = 39
openat(AT_FDCWD, "/tmp/.5effffd7fdd7ffeb-00000002.node", O_RDONLY|O_CLOEXEC) = 39
openat(AT_FDCWD, "/home/comario/.claude/ide", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/.claude/ide", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/.claude/ide", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/.claude/ide", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/.claude/ide", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/.claude/ide", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/.claude/ide", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/.claude/ide", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/.claude/ide", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/.claude/ide", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/.claude/ide", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)
openat(AT_FDCWD, "/home/comario/.claude/ide", O_RDONLY|O_DIRECTORY) = -1 ENOENT (No such file or directory)

Plugins

No response

OpenCode version

opencode --version
1.14.39

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 24.04.4 LTS
Release:        24.04
Codename:       noble

Terminal

I've tried different once, no impact.
Behavior is also the same when my shell is either zsh or bash

Activity

  1. github-actions commented on May 6, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    For keybind-related issues, please also check our pinned keybinds documentation: #4997

  2. mtremr commented on May 8, 2026

    @mtremr

    @bavarianbidi, I spotted the same issue with tui.json file -- can't override a keybind with it (having only default keybinds as in opencode.ai/tui.json). Used both proposed ~/.config/opencode folder for placing the file AND setting direct path to it via OPENCODE_TUI_CONFIG env var. I also have custom opencode.json successfully overriding some of behavior (placed in ~/.config/opencode folder). Also have $OPENCODE_CONFIG pointing to it. Nevertheless I don't see any call to the config file from strace log (repeated your steps successfully). My env: WSL2.

    lsb_release -a
    No LSB modules are available.
    Distributor ID: Ubuntu
    Description:    Ubuntu 22.04.5 LTS
    Release:        22.04
    Codename:       jammy

    So I guess it's not enough to simply strace the app to find configs applying.

  3. mtremr commented on May 8, 2026

    @mtremr

    @bavarianbidi, please check out expanded command below. I managed to see calls to opencode.json and tui.json (even to my custom tui8.json at which I'm pointing via OPENCODE_TUI_CONFIG env var).

    Start tracing with:

    strace -f -s 4096 -o /tmp/opencode-strace.txt -e trace=%file -- opencode

    Flags used above:

    -f              follow child processes
    -s 4096         print long path strings without truncation
    -o file         write strace output to a file
    -e trace=%file  trace file/path-related syscalls
    --              end of strace options; command starts after this
    

    Find tui*.json (like tui.json/tui.jsonc or tui8.json) with:

    grep openat /tmp/opencode-strace.txt | grep -iP "tui.*\.json"
  4. grehnen commented on May 9, 2026

    @grehnen

    having the same issue. @mtremr 's command shows tui.jsonc is accessed, but the keybindings in the file are not applied

  5. sollawen commented on May 10, 2026

    @sollawen

    having the same issue. .config/opencode/tui.json are not applied.

  6. bavarianbidi commented on May 12, 2026

    @bavarianbidi
    Author

    Will close this for now as the follow child process and print long path strings without truncation confirms, that opencode is reading my tui.json file.

    But the initial issue still persist: #11983

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions