Skip to content
This repository was archived by the owner on May 24, 2026. It is now read-only.
This repository was archived by the owner on May 24, 2026. It is now read-only.

Keybindings from previous mode persist when switching to search_mode #34

Description

@AnthonySmithDev

When transitioning from scroll_mode or copy_mode to search_mode, the keybindings from the previous mode remain active, interfering with the ability to type search queries. Specifically, keys like p, n, and others that have bindings in the previous modes are not available for typing in the search input.

Steps to Reproduce:

  1. Enter scroll_mode or copy_mode
  2. Press / to switch to search_mode
  3. Try to type a search query that includes letters like p or n
  4. Observe that these keys trigger their bound actions from the previous mode instead of being typed into the search

Expected Behavior:
When entering search_mode, only the keybindings defined for search_mode should be active, allowing all other keys to be typed normally into the search input.

Additional Context:
This appears to be an issue with the mode transition logic in the modal plugin. The keybinding tables from previous modes aren't being properly cleared when switching to search_mode.

Affected Files:

  • modal.wezterm plugin implementation
  • search_mode.lua keybindings
  • copy_mode.lua keybindings
  • scroll_mode.lua keybindings

Suggested Solution:
The mode transition should:

  1. Properly exit the current mode (clearing all its keybindings)
  2. Then activate the new mode with its own keybindings

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions