Skip to content

fix(editor): skip kitty new-tab when no listen socket to avoid Ctrl+E hang - #311

Open
FelixZhang wants to merge 1 commit into
RivoLink:mainfrom
FelixZhang:fix/kitty-editor-hang
Open

FelixZhang wants to merge 1 commit into
RivoLink:mainfrom
FelixZhang:fix/kitty-editor-hang

Conversation

@FelixZhang

Copy link
Copy Markdown

Summary

Fixes #310 — Ctrl+E freezing the whole TUI when leaf runs under herdr (or any PTY multiplexer) with kitty 0.49.1 and no allow_remote_control.

Root Cause

When KITTY_PID is present, leaf attempts kitty @ launch to open the editor in a new tab. Under a PTY multiplexer, the kitty-cmd DCS response cannot pass back through, so kitty @ waits indefinitely (confirmed with timeout 8 kitty @ ls). LaunchStrategy::RunAndCheck blocks in Command::status(), freezing the TUI before the in-place fallback can run. kitty 0.48.2 failed fast, which is why this started with the 0.49.1 upgrade.

Fix

Only attempt the kitty @ new-tab launch when KITTY_LISTEN_ON is set (socket mode). Without it, kitty @ cannot work reliably, so leaf falls straight through to the proven in-place editor path. This is independent of kitty's remote-control behavior and multiplexer environment.

Testing

  • Two new unit tests covering the KITTY_LISTEN_ON gate (present / absent)
  • Existing kitty_tab_title_uses_filename test updated for the gate
  • cargo test — 512 passed, 0 failed
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo build --release
  • Manually verified in herdr + kitty 0.49.1: Ctrl+E opens nvim in place and returns cleanly

The second commit collapses a nested else if flagged by nightly clippy on 1.28.3; no behavior change.

@FelixZhang
FelixZhang force-pushed the fix/kitty-editor-hang branch from f978cbd to 98f0a64 Compare September 29, 2026 06:55
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.

Ctrl+E hangs when running under herdr with kitty 0.49.1 (kitty @ blocks, in-place fallback never reached)

1 participant