Crash After Exiting Editor #3165

Open
opened 2026-02-16 17:38:55 -05:00 by yindo · 4 comments
Owner

Originally created by @aaronnewsome on GitHub (Nov 27, 2025).

Originally assigned to: @kommander on GitHub.

Description

Many times when using the editor (vim), after :wq it should return the text of the editor into the prompt, but instead it just crashes. Not all the time but when it does crash, it's super annoying when you've taken a long time to write a prompt and then POOF it's gone. The file is also immediately deleted from the /tmp directory, why - I don't know. I've got into the habit of saving to another file before exiting the editor (which is super cumbersome), but the one time I forget to save to another file, after 20 minutes of editing my prompt in the editor, :wq then CRASH! Super anoying.

OpenCode version

1.0.115

Steps to reproduce

I don't know how to reliably reproduce this issue. It shows up randomly, usually at the worst time!

Yes, I already searched for editor crash before I opened the bug. The two results are not the same issue.

Screenshot and/or share link

Image

Operating System

No response

Terminal

No response

Originally created by @aaronnewsome on GitHub (Nov 27, 2025). Originally assigned to: @kommander on GitHub. ### Description Many times when using the editor (vim), after :wq it should return the text of the editor into the prompt, but instead it just crashes. Not all the time but when it does crash, it's super annoying when you've taken a long time to write a prompt and then POOF it's gone. The file is also immediately deleted from the /tmp directory, why - I don't know. I've got into the habit of saving to another file before exiting the editor (which is super cumbersome), but the one time I forget to save to another file, after 20 minutes of editing my prompt in the editor, :wq then CRASH! Super anoying. ### OpenCode version 1.0.115 ### Steps to reproduce I don't know how to reliably reproduce this issue. It shows up randomly, usually at the worst time! Yes, I already searched for editor crash before I opened the bug. The two results are not the same issue. ### Screenshot and/or share link <img width="1784" height="712" alt="Image" src="https://github.com/user-attachments/assets/540c6ae7-b28a-47f4-bc59-ab7e89c7095a" /> ### Operating System _No response_ ### Terminal _No response_
yindo added the opentuibug labels 2026-02-16 17:38:55 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 27, 2025):

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

  • #3692: Closing the editor after editing the prompt does not restore the TUI
  • #4209: EDITOR=nvim hangs & some characters seem to pass to the opencode instead of nvim
  • #4586: $EDITOR keystrokes/redraw lag
  • #4646: Editor unusable after upgrade

These all involve editor-related crashes, TUI restoration issues, or problems exiting the editor. Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 27, 2025): This issue might be a duplicate of existing issues. Please check: - #3692: Closing the editor after editing the prompt does not restore the TUI - #4209: EDITOR=nvim hangs & some characters seem to pass to the opencode instead of nvim - #4586: $EDITOR keystrokes/redraw lag - #4646: Editor unusable after upgrade These all involve editor-related crashes, TUI restoration issues, or problems exiting the editor. Feel free to ignore if none of these address your specific case.
Author
Owner

@aaronnewsome commented on GitHub (Nov 27, 2025):

following up, this prompt pasted into the editor will consistently crash opencode after exiting the editor

docker compose build backend --no-cache
WARN[0000] /home/anewsome/Documents/git/rag-vault/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion 
Compose now can delegate build to bake for better performances
Just set COMPOSE_BAKE=true
[+] Building 59.5s (14/14) FINISHED                                                                                                                                                                                                             docker:default
 => [backend internal] load build definition from Dockerfile                                                                                                                                                                                              0.0s
 => => transferring dockerfile: 1.12kB                                                                                                                                                                                                                    0.0s
 => [backend internal] load metadata for docker.io/library/python:3.12-slim                                                                                                                                                                               4.4s
 => [backend internal] load .dockerignore                                                                                                                                                                                                                 0.0s
 => => transferring context: 2B                                                                                                                                                                                                                           0.0s
 => [backend 1/8] FROM docker.io/library/python:3.12-slim@sha256:b43ff04d5df04ad5cabb80890b7ef74e8410e3395b19af970dcd52d7a4bff921                                                                                                                         3.2s
 => => resolve docker.io/library/python:3.12-slim@sha256:b43ff04d5df04ad5cabb80890b7ef74e8410e3395b19af970dcd52d7a4bff921                                                                                                                                 0.0s
 => => sha256:b43ff04d5df04ad5cabb80890b7ef74e8410e3395b19af970dcd52d7a4bff921 10.37kB / 10.37kB                                                                                                                                                          0.0s
 => => sha256:971f04b358cf483ec445a8d388fb55267451f080d90fb136c8e69684a02a9604 1.75kB / 1.75kB                                                                                                                                                            0.0s
 => => sha256:445121148b187db67e48799f002500623fa22d9f635e522f4e0f345414bd9107 5.68kB / 5.68kB                                                                                                                                                            0.0s
 => => sha256:0e4bc2bd6656e6e004e3c749af70e5650bac2258243eb0949dea51cb8b7863db 29.78MB / 29.78MB                                                                                                                                                          0.8s
 => => sha256:490b9a1c25e472ab1cceab4ed6f3bd252006f7c6eea0ef7ba845c996adb6f302 1.29MB / 1.29MB                                                                                                                                                            0.2s
 => => sha256:0674d14a155c94f13e648265aa3ba62410e1fe0387fef64cc608388e54232880 12.11MB / 12.11MB                                                                                                                                                          0.4s
 => => sha256:b7ba6d2a1fc72f9587288b3b60221d1b07dae4f61a41360d2cc281fe7c007b3a 250B / 250B                                                                                                                                                                0.3s
 => => extracting sha256:0e4bc2bd6656e6e004e3c749af70e5650bac2258243eb0949dea51cb8b7863db                                                                                                                                                                 1.5s
 => => extracting sha256:490b9a1c25e472ab1cceab4ed6f3bd252006f7c6eea0ef7ba845c996adb6f302                                                                                                                                                                 0.1s
 => => extracting sha256:0674d14a155c94f13e648265aa3ba62410e1fe0387fef64cc608388e54232880                                                                                                                                                                 0.6s
 => => extracting sha256:b7ba6d2a1fc72f9587288b3b60221d1b07dae4f61a41360d2cc281fe7c007b3a                                                                                                                                                                 0.0s
 => [backend internal] load build context                                                                                                                                                                                                                 6.9s
 => => transferring context: 704.97MB                                                                                                                                                                                                                     6.8s
 => [backend 2/8] WORKDIR /app                                                                                                                                                                                                                            1.8s
 => [backend 3/8] RUN pip install --upgrade pip                                                                                                                                                                                                           2.9s
 => [backend 4/8] RUN apt-get update && apt-get install -y     curl     gcc     g++     make     libc6-dev     libpq-dev     && rm -rf /var/lib/apt/lists/*                                                                                               7.7s 
 => [backend 5/8] COPY backend/requirements.txt .                                                                                                                                                                                                         0.0s 
 => [backend 6/8] RUN pip install --no-cache-dir --upgrade pip &&     pip install --no-cache-dir -r requirements.txt || (echo "Pip install failed, retrying with individual packages" &&     pip install --no-cache-dir fastapi uvicorn sqlalchemy pyda  32.6s 
 => [backend 7/8] COPY . .                                                                                                                                                                                                                                4.5s 
 => [backend 8/8] RUN mkdir -p /app/documents /app/vector_db /app/data                                                                                                                                                                                    0.1s 
 => [backend] exporting to image                                                                                                                                                                                                                          2.2s 
 => => exporting layers                                                                                                                                                                                                                                   2.2s 
 => => writing image sha256:30cfae9623ba77e8d1f9be0b759cc4323f8d2c764c1fb640c4f4e203d7fd08c6                                                                                                                                                              0.0s 
 => => naming to docker.io/library/rag-vault-backend                                                                                                                                                                                                      0.0s 
 => [backend] resolving provenance for metadata file                                                                                                                                                                                                      0.0s
[+] Building 1/1
 ✔ backend  Built                                                                             

removing the last line with the character and opencode doesn't crash on editor exit.

@aaronnewsome commented on GitHub (Nov 27, 2025): following up, this prompt pasted into the editor will consistently crash opencode after exiting the editor ``` docker compose build backend --no-cache WARN[0000] /home/anewsome/Documents/git/rag-vault/docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion Compose now can delegate build to bake for better performances Just set COMPOSE_BAKE=true [+] Building 59.5s (14/14) FINISHED docker:default => [backend internal] load build definition from Dockerfile 0.0s => => transferring dockerfile: 1.12kB 0.0s => [backend internal] load metadata for docker.io/library/python:3.12-slim 4.4s => [backend internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [backend 1/8] FROM docker.io/library/python:3.12-slim@sha256:b43ff04d5df04ad5cabb80890b7ef74e8410e3395b19af970dcd52d7a4bff921 3.2s => => resolve docker.io/library/python:3.12-slim@sha256:b43ff04d5df04ad5cabb80890b7ef74e8410e3395b19af970dcd52d7a4bff921 0.0s => => sha256:b43ff04d5df04ad5cabb80890b7ef74e8410e3395b19af970dcd52d7a4bff921 10.37kB / 10.37kB 0.0s => => sha256:971f04b358cf483ec445a8d388fb55267451f080d90fb136c8e69684a02a9604 1.75kB / 1.75kB 0.0s => => sha256:445121148b187db67e48799f002500623fa22d9f635e522f4e0f345414bd9107 5.68kB / 5.68kB 0.0s => => sha256:0e4bc2bd6656e6e004e3c749af70e5650bac2258243eb0949dea51cb8b7863db 29.78MB / 29.78MB 0.8s => => sha256:490b9a1c25e472ab1cceab4ed6f3bd252006f7c6eea0ef7ba845c996adb6f302 1.29MB / 1.29MB 0.2s => => sha256:0674d14a155c94f13e648265aa3ba62410e1fe0387fef64cc608388e54232880 12.11MB / 12.11MB 0.4s => => sha256:b7ba6d2a1fc72f9587288b3b60221d1b07dae4f61a41360d2cc281fe7c007b3a 250B / 250B 0.3s => => extracting sha256:0e4bc2bd6656e6e004e3c749af70e5650bac2258243eb0949dea51cb8b7863db 1.5s => => extracting sha256:490b9a1c25e472ab1cceab4ed6f3bd252006f7c6eea0ef7ba845c996adb6f302 0.1s => => extracting sha256:0674d14a155c94f13e648265aa3ba62410e1fe0387fef64cc608388e54232880 0.6s => => extracting sha256:b7ba6d2a1fc72f9587288b3b60221d1b07dae4f61a41360d2cc281fe7c007b3a 0.0s => [backend internal] load build context 6.9s => => transferring context: 704.97MB 6.8s => [backend 2/8] WORKDIR /app 1.8s => [backend 3/8] RUN pip install --upgrade pip 2.9s => [backend 4/8] RUN apt-get update && apt-get install -y curl gcc g++ make libc6-dev libpq-dev && rm -rf /var/lib/apt/lists/* 7.7s => [backend 5/8] COPY backend/requirements.txt . 0.0s => [backend 6/8] RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt || (echo "Pip install failed, retrying with individual packages" && pip install --no-cache-dir fastapi uvicorn sqlalchemy pyda 32.6s => [backend 7/8] COPY . . 4.5s => [backend 8/8] RUN mkdir -p /app/documents /app/vector_db /app/data 0.1s => [backend] exporting to image 2.2s => => exporting layers 2.2s => => writing image sha256:30cfae9623ba77e8d1f9be0b759cc4323f8d2c764c1fb640c4f4e203d7fd08c6 0.0s => => naming to docker.io/library/rag-vault-backend 0.0s => [backend] resolving provenance for metadata file 0.0s [+] Building 1/1 ✔ backend Built ``` removing the last line with the ` ✔ ` character and opencode doesn't crash on editor exit.
Author
Owner

@rekram1-node commented on GitHub (Nov 27, 2025):

thank you for info, we will fix

@rekram1-node commented on GitHub (Nov 27, 2025): thank you for info, we will fix
Author
Owner

@kommander commented on GitHub (Dec 20, 2025):

Is this still an issue?

@kommander commented on GitHub (Dec 20, 2025): Is this still an issue?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3165