Skip to content

[BUG] CTRL+Z will brick your claude code instance #194

Description

@armanschwarz

Bug Description

Pressing CTRL+Z while in terminal mode on a running claude code window places it into a background state:

Claude Code has been suspended. Run `fg` to bring Claude Code back.
Note: ctrl + z now suspends Claude Code, ctrl + _ undoes input.

After this, no amount of stopping, closing, restarting seems to get it back. You basically have to exit vim and start it again as far as I can tell.

To Reproduce

See above

Expected Behavior

Suspend vim entirely as if you were in any other window, rather than suspending the nested instance.

Environment

  • Neovim version: 0.11.5
  • Claude Code CLI version: 2.1.45
  • OS: rocky linux
  • Plugin version: aa9a5

Error Messages

N/A

Additional Context

This works for me as a workaround:

    vim.api.nvim_create_autocmd("TermOpen", {
      callback = function(ev)
        local buf_name = vim.api.nvim_buf_get_name(ev.buf)
        if buf_name:match("claude") then
          vim.keymap.set("t", "<C-z>", "<cmd>suspend<CR>", {
            buffer = ev.buf,
            desc = "Suspend Vim from Claude terminal",
          })
        end
      end,
    })

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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