Skip to content

fix(vterm): buffer read-only error after compiling#8623

Open
AjaiKN wants to merge 1 commit into
doomemacs:masterfrom
AjaiKN:vterm-error-after-compile
Open

fix(vterm): buffer read-only error after compiling#8623
AjaiKN wants to merge 1 commit into
doomemacs:masterfrom
AjaiKN:vterm-error-after-compile

Conversation

@AjaiKN

@AjaiKN AjaiKN commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

The first time I run +vterm/toggle, if I say yes to vterm's offer to compile libvterm for me, then after it compiles successfully, I get this error: vterm-mode: Buffer is read-only: #<buffer *Install vterm* >. That's because when vterm is autoloaded, it changes the current buffer to the compilation buffer, which is read-only. If I actually want a vterm buffer, I need to run +vterm/toggle a second time.

Instead, we can explicitly require vterm before with-current-buffer so it's already loaded before we call vterm-mode.


  • I searched the issue tracker and this hasn't been PRed before.
  • My changes are not on the do-not-PR list for this project.
  • My commits conform to Doom's git conventions.
  • I am blindly checking these off.
  • This PR contains AI-generated work.
  • Any relevant issues or PRs have been linked to.
  • This a draft PR; I need more time to finish it.

If libvterm hasn't been compiled yet when vterm first loads, it'll offer
to compile it for you. If you say yes, then vterm will switch to the
compilation buffer.

If vterm was autoloaded from a vterm-mode call, this is a problem: by
the time the vterm-mode function runs, the current buffer will be the
compilation buffer. The vterm-mode call will fail because the
compilation buffer is read-only.

Instead, we can explicitly require vterm before with-current-buffer so
it's already loaded before we call vterm-mode.
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.

1 participant