[BUG] Ctrl+G external editor (nano/micro) fails silently over SSH - editor never appears

Resolved 💬 4 comments Opened Jan 18, 2026 by NodeDiver Closed Feb 27, 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?

Environment

| Item | Value |
|------|-------|
| Claude Code Version | 2.1.12 |
| OS | Ubuntu 24.04.3 LTS (Ubuntu MATE) |
| Kernel | Linux 6.14.0-37-generic x86_64 |
| Hardware | Intel Core i7-12700T, 64GB RAM |
| Shell | zsh 5.9 with oh-my-zsh |
| EDITOR | micro 2.0.13 (also tested with nano 7.2) |
| TERM | xterm-256color |
| SSH Client | PowerShell 7.5.4 (Windows 10) via OpenSSH |
| Connection | SSH from Windows 10 to Ubuntu desktop |

Description

When using Ctrl+G to edit the prompt in an external editor over an SSH session, the editor never appears. The prompt area changes to show "save and close editor to continue" but no editor opens in the terminal. After a few seconds (~3-5s), it automatically returns to the normal prompt with the original text unchanged.

This happens with both micro and nano as the configured $EDITOR.

Steps to Reproduce

  1. SSH into Ubuntu machine from Windows using PowerShell 7:

``
ssh user@hostname
``

  1. Start Claude Code session:

``
claude
``

  1. Type some text in the prompt (e.g., "test prompt text")
  2. Press Ctrl+G
  3. Observe:
  • Prompt area changes
  • Message "save and close editor to continue" appears
  • No editor is visible in the terminal
  1. After ~3-5 seconds, returns to normal prompt with original text

Expected Behavior

A terminal-based editor (micro or nano) should open within the same terminal session, displaying the current prompt text. User should be able to edit the text, save, and exit. The edited text should then appear in Claude Code's prompt.

Actual Behavior

  • Prompt UI changes to "save and close editor to continue"
  • No editor window/interface appears in the terminal
  • No visible error messages
  • After a few seconds, silently returns to normal prompt
  • Original text is preserved (no changes possible)

Debugging Attempted

  1. Verified EDITOR is set correctly:

``bash
echo $EDITOR # outputs: micro
echo $VISUAL # outputs: micro
``

  1. Editors work normally when invoked directly:

``bash
micro /tmp/test.txt # Works perfectly
nano /tmp/test.txt # Works perfectly
``

  1. Tested with wrapper script forcing TTY:

``bash
#!/bin/bash
exec micro "$@" < /dev/tty > /dev/tty
``
Same result - editor never appears.

  1. Tested with nano instead of micro:

Same behavior - editor never appears.

  1. Environment variables are exported in ~/.zshenv:

``bash
export EDITOR="micro"
export VISUAL="micro"
``

Hypothesis

The editor process appears to be spawned but without proper TTY attachment in the SSH session context. The editor likely starts, finds no TTY to attach to, and exits immediately or is killed. This is similar to issues reported in:

  • #11439 (TTIN suspension with emacs - closed)
  • #11286 (Micro freezing on macOS - closed as duplicate)
  • #10492 (Helix frozen interface - closed as duplicate)

However, those issues were on local sessions. This issue is specific to SSH sessions where the TTY handling may be different.

Workaround

None found. Currently composing long prompts in external editor manually and pasting into Claude Code.

Additional Context

  • The Ubuntu machine works fine when accessed locally (not tested Ctrl+G locally, only via SSH)
  • SSH connection is stable and fully functional for all other terminal operations
  • Interactive terminal programs (vim, htop, micro, nano) all work correctly over this SSH connection
  • Only Claude Code's Ctrl+G feature fails to display the editor

Possibly Related Issues

  • #11439 - Ctrl-G external editor invocation causes TTIN suspension (macOS, local)
  • #11286 - Micro editor integration freezes (macOS, local)
  • #10492 - C-g editor integration with Helix causes frozen interface (macOS, local)
  • #8762 - /terminal-setup not available via SSH

What Should Happen?

A local editor should open after ctrl +g

Error Messages/Logs

-

Steps to Reproduce

ssh from windows into an ubuntu and open a claude session + press ctrl + g

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.12

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Windows Terminal

Additional Information

It's all in the "What's Wrong?" section.

View original on GitHub ↗

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