Skip to content

fix(tmux) Added extra ways of preventing hanging opencode instances#172

Merged
nickjvandyke merged 3 commits intonickjvandyke:mainfrom
Megatherium:main
Feb 19, 2026
Merged

fix(tmux) Added extra ways of preventing hanging opencode instances#172
nickjvandyke merged 3 commits intonickjvandyke:mainfrom
Megatherium:main

Conversation

@Megatherium
Copy link
Contributor

  1. By trimming the return value of tmux split-window we ensure that no newline gets added to self.pane_id which always has the potential for weird behaviour

  2. We're basically "doubly killing" the opencode pane now by first retrieving his PID. Should tmux kill-pane somehow fail an immediate kill should do the trick.

  3. By moving the autocmd from VimLeave to VimLeavePre the command actually fires in case of a e.g. :q!

Description

When having an opencode instance running and you quit out with :q! (before you quit the opencode instance via e.g. Ctrl+c), you are left with an orphaned process that at the same time prevents the spawning of OC instances in ANY nvim instance (with the message "Response decode error: Not Found; Vim:E474: Unidentified byte: Not Found"

Related Issue(s)

#118

1. By trimming the return value of `tmux split-window` we ensure that no
newline gets added to self.pane_id which always has the potential for
weird behaviour

2. We're basically "doubly killing" the opencode pane now by first
retrieving his PID. Should `tmux kill-pane` somehow fail an immediate
`kill` should do the trick.

3. By moving the autocmd from VimLeave to VimLeavePre the command
actually fires in case of a e.g. :q!
@nickjvandyke nickjvandyke merged commit 1e31bbc into nickjvandyke:main Feb 19, 2026
2 checks passed
@nickjvandyke
Copy link
Owner

Thanks for this! I think sending ctrl-c in #178 makes a little more sense, but I took your VimLeavePre change still 😀

Sorry if I missed the changes you pushed to this branch!

@Megatherium
Copy link
Contributor Author

All's well. You've got enough stuff to take care of. Luckily we're living in times where this didn't cost me hours to research and implement. Just happy the project exists and is still being improved.

@nickjvandyke
Copy link
Owner

I appreciate your words 😀

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments