Skip to content

Vim mode: Esc stops leaving Insert mode after switching modes with two connection windows open #2914

Closed

Description

@jiangjc3

What happened?

Environment

  • TablePro 0.74.0 (build 130)
  • macOS 15.7.9 (24G830), Apple Silicon (arm64)
  • Settings > Editor > Vim mode: enabled
  • Database type: MySQL
  • Input method: ABC (no IME marked text active)
  • Hammerspoon is running, but its only key interception is Option+E — Escape is not remapped

Summary

After switching between Insert and Normal mode a few times, pressing Esc from Insert mode no longer returns to Normal mode. The mode badge stays on INSERT. Ctrl+[ still works. Restarting the app fixes it, but the problem comes back.

Steps to reproduce

  1. Enable Vim mode in Settings > Editor.
  2. Open two connections, each in its own window.
  3. In a query tab, press i to enter Insert mode and type some SQL.
  4. Press Esc (works at this point), then toggle Insert/Normal a few more times.
  5. Press Esc from Insert mode again.

Expected

Esc returns to Normal mode (as documented in the Vim Mode docs).

Actual

Nothing happens; the mode badge stays on INSERT. Cmd-based shortcuts (e.g. Cmd+Enter) still work.

Workarounds tried

  • Ctrl+[ always switches back to Normal mode — this is the only reliable way out of Insert mode while the bug is active.
  • Closing one of the two connection windows did not help.
  • Quitting and relaunching TablePro fixed it; Esc worked again afterwards.
  • The Edit menu's "Clear Selection" item is still bound to bare Esc (Settings > Keyboard > Data Grid); I have not changed it.

Additional context (source reading, 0.74.0 tag)

Escape appears to have four competing paths in this build, which may be where the state gets wedged:

  • VimKeyInterceptor.handleKeyEvent — the event.keyCode == 53 branch that hands Escape to the Vim engine.
  • SuggestionController.handleKeyDown — case kVK_Escape: close(); return nil, which consumes the keystroke.
  • The popup's NSWindow.willCloseNotification observer in VimKeyInterceptor, which re-dispatches Escape to the engine.
  • The bare-Escape key equivalent on Edit > Clear Selection (KeyboardShortcutModels.swift:565, .clearSelection: .special(.escape)), with the external-source hand-off in EditorEventRouter.handleEscapeFromMenu() → handleEscapeFromExternalSource().

I couldn't attach logs: log show --last 10m --predicate 'subsystem == "com.TablePro"' produced no output on my machine, and a live log stream capture was also empty. Happy to run any diagnostic you suggest.

Steps to reproduce

No response

Expected behavior

No response

Database type

None

TablePro version

0.76.0

macOS version & chip

macOS 15.7.9 (24G830), Apple Silicon (arm64)

Screenshots / Logs

No response

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

Metadata

Metadata

Assignees

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions