Loading ...
Sorry, an error occurred while loading the content.

Re: Mapping meta key within tmux

Expand Messages
  • Thomas E. Dickey
    ... It s vague - saying that the entry has to be a derivative of screen , without saying in what way. A quick check on my Fedora18beta shows that someone s
    Message 1 of 6 , Jul 13, 2013
    • 0 Attachment
      On Friday, July 12, 2013 7:06:23 PM UTC-4, Gary Johnson wrote:
      > The problem is that tmux sets TERM to "screen" and the key
      > definitions in the terminfo database for "screen" don't match those
      > of the terminal you are actually using.
      >
      > One way to fix this would be to make tmux set TERM to the name of
      > the terminal you are actually using, except that the tmux(1) man
      > page says not to do this.

      :-(

      It's vague - saying that the entry has to be a derivative of "screen",
      without saying in what way. A quick check on my Fedora18beta shows
      that someone's setting it to screen-256color.

      "screen" on the other hand provides for the ability to map TERM
      into screen.$TERM if that happens to be available. I added several
      entries to the terminal database to use this feature simply because
      screen never matches any of the terminals exactly (line-drawing,
      color, function keys all have issues).

      tmux does not appear to implement this mapping (If tmux adopted
      that feature, it would be an improvement).

      --
      --
      You received this message from the "vim_use" maillist.
      Do not top-post! Type your reply below the text you are replying to.
      For more information, visit http://www.vim.org/maillist.php

      ---
      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Gary Johnson
      ... I didn t have much time for experimentation when I first replied. Now that I have a little more time, mapping the sequence for proved more difficult
      Message 2 of 6 , Jul 14, 2013
      • 0 Attachment
        On 2013-07-13, Marco wrote:
        > On 2013–07–12 Gary Johnson wrote:
        >
        > > > How can I map M-<arrow-keys> to something useful when I run vim in
        > > > tmux?

        > > Another way to fix this is to redefine those keys in your
        > > ~/.tmux.conf as I have done in mine for function keys.
        > >
        > > # To fix screen terminfo function key entries when using PuTTY:
        > > #
        > > # From https://gist.github.com/pickerweng/1713936
        > > #
        > > set -g terminal-overrides "*:kf1=\e[11~:kf2=\e[12~:kf3=\e[13~:kf4=\e[14~:kf5=\e[15~:kf6=\e[17~:kf7=\e[18~:kf8=\e[19~"
        >
        > I can't figure out the correct command line. The terminfo man page
        > is a terrible read.
        >
        > > Yet another way is to redefine those keys in your ~/.vimrc as I did
        > > originally fix the same problem.
        >
        > That's what I wanted to do. Actually I have similar mapping as you
        > do. But I can't figure out the right mapping for Meta-<arrow-keys>.
        >
        > # mappings like these work
        > noremap <esc>[27;5;9~ :bnext!<cr>
        >
        > # the meta-<up> mapping does not work
        > noremap <esc>[1;3A :bnext!<cr>
        >
        > > I'll leave it to you to come up with the mappings you need in your
        > > case,
        >
        > That was actually my question, what these mappings are.

        I didn't have much time for experimentation when I first replied.
        Now that I have a little more time, mapping the sequence for <M-Up>
        proved more difficult than I expected. I think the secret is to put
        this in your ~/.tmux.conf:

        set -g xterm-keys on

        After doing that, my mappings of <Esc>[1;3A seemed to work.

        HTH,
        Gary

        --
        --
        You received this message from the "vim_use" maillist.
        Do not top-post! Type your reply below the text you are replying to.
        For more information, visit http://www.vim.org/maillist.php

        ---
        You received this message because you are subscribed to the Google Groups "vim_use" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Marco
        ... The combination of xterm-keys and the [1;3A mapping works. Thanks a lot. Marco -- -- You received this message from the vim_use maillist. Do not
        Message 3 of 6 , Jul 15, 2013
        • 0 Attachment
          On 2013–07–14 Gary Johnson wrote:

          > I didn't have much time for experimentation when I first replied.
          > Now that I have a little more time, mapping the sequence for <M-Up>
          > proved more difficult than I expected. I think the secret is to put
          > this in your ~/.tmux.conf:
          >
          > set -g xterm-keys on
          >
          > After doing that, my mappings of <Esc>[1;3A seemed to work.

          The combination of xterm-keys and the <Esc>[1;3A mapping works.
          Thanks a lot.

          Marco

          --
          --
          You received this message from the "vim_use" maillist.
          Do not top-post! Type your reply below the text you are replying to.
          For more information, visit http://www.vim.org/maillist.php

          ---
          You received this message because you are subscribed to the Google Groups "vim_use" group.
          To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
          For more options, visit https://groups.google.com/groups/opt_out.
        Your message has been successfully submitted and would be delivered to recipients shortly.