! <command> does not open interactive editors (e.g. vim) in the terminal

Resolved 💬 3 comments Opened Mar 25, 2026 by gjmilne Closed Mar 29, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using the ! prefix to run shell commands in Claude Code, commands that require an interactive TTY (such as git commit --edit, which opens $EDITOR/vim) do not work -- the
editor never appears. The command runs silently in a non-interactive shell and the editor is effectively swallowed.

Expected behaviour: ! git commit --edit opens the configured editor (e.g. vim) in the Claude Code terminal, allowing the user to edit the commit message interactively.

Actual behaviour: No editor appears. The command completes without prompting for input.

Workaround: Open a separate terminal and run git commit --edit there, or use git commit -m "..." --edit from a proper TTY.

Platform: Linux (Ubuntu), shell: bash

What Should Happen?

Expected behaviour: ! git commit --edit opens the configured editor (e.g. vim) in the Claude Code terminal, allowing the user to edit the commit message interactively.

Error Messages/Logs

Steps to Reproduce

  1. ask claude to generate a commit message
  2. then ask claude how to edit it to make changes
  3. claude then come up with ! git commit --edit
  4. when you paste that in as a command it gets swallowed and no editing happens

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.81

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

I am running the kitty terminal emulator on Ubuntu/Debian Linux

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗