Skip to content

option (alt) not works in :terminal #868

Open

Description

@epheien

Reproduce

:terminal
echo hello<CR>
<M-.>

not show 'hello'

but it works when macvim run in Terminal

Activity

  1. ychin commented on Feb 22, 2019

    @ychin
    Member

    Hmm what's the issue here? What shell are you using and what were you expecting?

  2. ychin commented on Feb 22, 2019

    @ychin
    Member

    Also, do you have set macmeta? Does setting that help?

  3. epheien commented on Feb 22, 2019

    @epheien
    Author

    Finnally,I found a solution:

    " I don't known why this line not work..., it seems a bug
    "tnoremap <M-.> <C-w>:<C-u>call term_sendkeys(bufnr('%'), "\<Esc>.")<CR>
    tnoremap <silent> <M-.> <C-w>:call <SID>tmap_meta('.')<CR>
    function s:tmap_meta(key)
        call term_sendkeys(bufnr('%'), "\<Esc>" . a:key)
    endfunction
    
  4. added
    InputIssues related to keyboard or other types of input
    on Feb 22, 2019
  5. ychin commented on Feb 22, 2019

    @ychin
    Member

    Oh I see, basically the shell you were using was expecting Meta-<key> sequence to be encoding as <Esc> + <key>, which is how most shells work, but in GVim (and MacVim under macmeta) it uses 8-bit encoding (do :h xterm-8bit) so it's not really compatible.

    This ties to a larger ongoing issue about how Vim should be handling meta keys and would need some thought and collaboration with Vim to figure this out. I think for now you will need to keep your workaround.

    Keeping this issue open for tracking.

  6. added this to the Release 175 milestone on Aug 9, 2022
  7. modified the milestones: Release 175, Release 176 on Oct 11, 2022
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

    InputIssues related to keyboard or other types of input

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions