Skip to content

Can't change tabs when in terminal #1045

Closed

Description

@barreyra

When entering a terminal, I can no longer change tabs using Cmd-{}, not create a new one using Cmd-T, presumably because these keys get passed on to the terminal.

Activity

  1. eirnym commented on May 6, 2020

    @eirnym
    Contributor

    @barreyra, Thank you for an issue,

    If you're talking about Apple's Terminal.app, it doesn't support passing Cmd key to apps. Some other terminal apps has limited support for this feature

  2. barreyra commented on May 6, 2020

    @barreyra
    Author

    I'm talking about the MacVim GUI. I can use those keys normally to switch between tabs in other buffers, but if the current selected buffer is a :terminal, it doesn't work.

  3. eirnym commented on May 6, 2020

    @eirnym
    Contributor

    As far as I understand, Vim captures the input and then sends it to the terminal, which is not the same as you process a key directly. Also Vim's terminal emulator is not perfect enough to be compared to Xterm, for example.

  4. barreyra commented on May 8, 2020

    @barreyra
    Author

    Aha, I figured out my own issue. The terminal has its own set of key-bindings. The following adds the basic tab navigation commands:

    tmap <D-t> <C-W>:tabnew<CR>
    tmap <D-}> <C-W>:tabn<CR>
    tmap <D-{> <C-W>:tabp<CR>
    

    It seems the problem is that the :macmenu command doesn't map things in the terminal.

  5. ychin commented on Aug 12, 2020

    @ychin
    Member

    I think the issue is that the menu entries are not properly mapped. This will be fixed next release to have the tab menu items properly mapped in terminal mode. (They need to use tlmenu instead of the generic amenu since terminal menus work well enough that the generic amenu doesn't work with it)

  6. added a commit that references this issue on Aug 12, 2020
    0b58aa1
  7. added this to the snapshot-164 milestone on Aug 12, 2020
  8. ychin commented on Aug 12, 2020

    @ychin
    Member

    This is now fixed. @barreyra feel free to remove your own mappings once the new version (164) is out soon. MacVim will do the right thing.

  9. barreyra commented on Aug 16, 2020

    @barreyra
    Author

    Thank you, it works great. Cmd-w and Cmd-b are still missing, I'll post a patch if no one else does.

  10. ychin commented on Aug 16, 2020

    @ychin
    Member

    I'm not sure if Cmd-W would work. It's mapped to :conf q which I don't think works inside terminal mode. I could see Cmd-B though.

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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions