Skip to content

workmux sometimes makes tmux crash #83

@joaobibiano

Description

@joaobibiano

Summary

When I run workmux remove from inside the worktree's own tmux window, tmux sometimes crashes with SIGSEGV.

This looks like it happens during workmux cleanup after it detects that removal is being triggered from the current target window and defers destructive cleanup. The tmux crash report points at tmux's run-shell callback path.

Environment

  • workmux: 0.1.140
  • tmux: 3.5a
  • tmux binary: /opt/homebrew/bin/tmux
  • macOS: 26.3 (25D125)
  • workmux binary: /Users/j/.local/bin/workmux

Reproduction

I don't have a fully minimal repro yet, but this is the pattern I've seen multiple times:

  1. Create a worktree with workmux add <branch>
  2. Stay inside the newly created tmux window for that worktree
  3. Run workmux remove
  4. tmux sometimes crashes instead of removing the worktree/window cleanly

The common factor seems to be: workmux remove is invoked from inside the same tmux window being removed.

Expected

  • workmux remove should close the tmux window and clean up the worktree/branch without crashing tmux

Actual

  • tmux crashes with SIGSEGV
  • macOS crash report says:
    • EXC_BAD_ACCESS (SIGSEGV)
    • crashed on child side of fork pre-exec

Relevant workmux logs

From ~/.local/state/workmux/workmux.log:

Crash on 2026-03-20

2026-03-20T12:18:45.765044Z  INFO workmux start args=["workmux", "remove"]
2026-03-20T12:18:47.173090Z  INFO remove:start handle="feature-int-2944" force=true keep_branch=false
2026-03-20T12:18:47.322786Z  INFO remove:cleanup start branch=feature/int-2944 keep_branch=false
2026-03-20T12:18:47.333431Z  INFO cleanup:start branch="feature/int-2944" handle="feature-int-2944" path=/Users/user/projects/repo/repo__worktrees/feature-int-2944 force=true keep_branch=false mode="window"
2026-03-20T12:18:47.343694Z  INFO cleanup:running inside matching target, deferring destructive cleanup branch="feature/int-2944" current_target=" feature-int-2944" kind="window"
2026-03-20T12:18:47.347832Z  INFO cleanup:running pre-remove hooks branch="feature/int-2944" count=1

Crash on 2026-03-18 / 2026-03-19 UTC

2026-03-19T01:13:43.891929Z  INFO workmux start args=["workmux", "remove"]
2026-03-19T01:13:45.676849Z  INFO remove:start handle="feature-int-3116" force=true keep_branch=false
2026-03-19T01:13:45.821149Z  INFO remove:cleanup start branch=feature/int-3116 keep_branch=false
2026-03-19T01:13:45.822023Z  INFO cleanup:start branch="feature/int-3116" handle="feature-int-3116" path=/Users/user/projects/repo/repo__worktrees/feature-int-3116 force=true keep_branch=false
2026-03-19T01:13:45.830333Z  INFO cleanup:running inside matching window, deferring destructive cleanup branch="feature/int-3116" current_window=" feature-int-3116"
2026-03-19T01:13:45.833330Z  INFO cleanup:running pre-remove hooks branch="feature/int-3116" count=1

tmux crash report details

I have two matching crash reports:

  • ~/Library/Logs/DiagnosticReports/tmux-2026-03-20-091854.ips
  • ~/Library/Logs/DiagnosticReports/tmux-2026-03-18-221352.ips

Both show the same kind of crash:

exception: EXC_BAD_ACCESS / SIGSEGV
asi: crashed on child side of fork pre-exec

And the stack includes tmux internal run-shell/print callback code:

proc_send
file_vprint
file_print
server_client_print
cmdq_print
cmd_run_shell_print
cmd_run_shell_callback
job_check_died
server_signal

Config context

Global workmux config

~/.config/workmux/config.yaml

nerdfont: true
agent: opencode
status_format: false

Project workmux config

This project defines panes, but no custom pre_remove hook:

main_branch: master

panes:
  - command: <agent>
    focus: true
  - command: cp -R ~/projects/repo/repo/certs/* ./certs/ && cp ~/projects/repo/repo/.env.local ./.env.local && pnpm install
    split: horizontal
    size: 50

There is no pre_remove: configured in this project config.

tmux config

My tmux config includes these plugins:

  • tmux-plugins/tmux-sensible
  • christoomey/vim-tmux-navigator
  • catppuccin/tmux
  • tmux-plugins/tmux-resurrect
  • tmux-plugins/tmux-continuum

Notes

  • This may ultimately be a tmux bug, but workmux remove seems to trigger it reliably enough to report here first.
  • The strongest signal in the logs is that the crash happens specifically when cleanup is being performed from inside the same target window being removed.
  • I can try to produce a more minimal repro if useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions