Skip to content

[suggestion] Cancel modal operations by pression ESC #78

Closed

Description

@ttohin

For example: When I press g I see a modal menu "Position to go". To hide the menu without changing the position I should keep input empty and press Enter. More than I'll error message "Invalid format". And the same with "find" menu.
I think It should be more "vi like" - Pressing ESC interrupts any modal operations.

Activity

  1. arybczak commented on Oct 29, 2015

    @arybczak
    Collaborator

    You can already do that with Ctrl-C/Ctrl-G. AFAIR I tried to make ESC also work, but readline didn't want to cooperate with me.

  2. trygveaa commented on Oct 29, 2015

    @trygveaa
    Contributor

    Ctrl-C/Ctrl-G doesn't seem to work for me. Nothing happens. (version 0.6.7)

  3. ttohin commented on Oct 29, 2015

    @ttohin
    ContributorAuthor

    +1

  4. arybczak commented on Oct 29, 2015

    @arybczak
    Collaborator

    It's in 0.7.x.

  5. doronbehar commented on May 13, 2017

    @doronbehar

    Hello @arybczak,
    I was wondering, have you triedever since this issue was closed to recheck this problem?

  6. arybczak commented on May 14, 2017

    @arybczak
    Collaborator

    I didn't. The issue is that readline can't seem to be able to recognise ESC while also be able to process special keys such as arrows. You're welcome to try making it do that though.

  7. matt-snider commented on Nov 5, 2018

    @matt-snider

    I tried doing this:

    def_key "escape"
        abort_prompt
    

    but I see this code and realize it's not exposed in actions.h so it won't work. Is there any other way of doing it? Esc is really intuitive from other programs (e.g. vim)

  8. mrusme commented on Sep 10, 2022

    @mrusme

    This still doesn't seem to be working out of the box unfortunately.

    Pressing ctrl+s in a playlist to open the sort dialog and then pressing escape doesn't lead to it being dismissed. Presseing g to open the "Position to go" prompt and then pressing escape doesn't do anything, leaving one stuck in the prompt.

    Imho this issue needs to be re-opened as user experience is really bad in this regard. Generally it should imho be possible to dismiss any prompt/popup/... by default, using the escape key.

  9. kohane27 commented on Feb 6, 2024

    @kohane27

    I've found a workaround with xremap. We can map jk to Ctrl-C.

    We need --class dropdown_right for xremap to identify this specific terminal window:

    kitty --class dropdown_right zsh -i -c "ncmpcpp".

    Then we can put the following in ~/.config/xremap/config.yml:

    keymap:
      - name: ncmpcpp
        application:
          only: [dropdown_right]
        remap:
          J:
            remap:
              K: C-c
            timeout_key: KEY_J
            timeout_millis: 40

    Restart your xremap for it to take effect. Cheers!

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions