Option key does not work as Meta in Tmux












19















I am using Mac OSX Lion. I have checked "Use Option key as Meta" in Terminal preferences. Although the Option key seems to work fine as Meta in Bash, when I use it in Tmux (over SSH) it does not work properly. I am trying to use TMUX shortcuts like ^b M-1 b M-2 etc. I can get these with the ESC key but not the Option key.










share|improve this question























  • ^b Space with cycle through the various layouts

    – caspyin
    Mar 22 '14 at 14:03
















19















I am using Mac OSX Lion. I have checked "Use Option key as Meta" in Terminal preferences. Although the Option key seems to work fine as Meta in Bash, when I use it in Tmux (over SSH) it does not work properly. I am trying to use TMUX shortcuts like ^b M-1 b M-2 etc. I can get these with the ESC key but not the Option key.










share|improve this question























  • ^b Space with cycle through the various layouts

    – caspyin
    Mar 22 '14 at 14:03














19












19








19


3






I am using Mac OSX Lion. I have checked "Use Option key as Meta" in Terminal preferences. Although the Option key seems to work fine as Meta in Bash, when I use it in Tmux (over SSH) it does not work properly. I am trying to use TMUX shortcuts like ^b M-1 b M-2 etc. I can get these with the ESC key but not the Option key.










share|improve this question














I am using Mac OSX Lion. I have checked "Use Option key as Meta" in Terminal preferences. Although the Option key seems to work fine as Meta in Bash, when I use it in Tmux (over SSH) it does not work properly. I am trying to use TMUX shortcuts like ^b M-1 b M-2 etc. I can get these with the ESC key but not the Option key.







macos osx-lion tmux






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Sep 25 '13 at 5:07









PhaniPhani

273137




273137













  • ^b Space with cycle through the various layouts

    – caspyin
    Mar 22 '14 at 14:03



















  • ^b Space with cycle through the various layouts

    – caspyin
    Mar 22 '14 at 14:03

















^b Space with cycle through the various layouts

– caspyin
Mar 22 '14 at 14:03





^b Space with cycle through the various layouts

– caspyin
Mar 22 '14 at 14:03










4 Answers
4






active

oldest

votes


















13














I would suggest using iTerm2 instead of the default Terminal.app, as it is better for many reasons.



Specifically, you would be interested in iTerm2's options to map left/right option as "+Esc", which works much better than trying to have it emulate Meta for every purpose I can think of or have tried.



This setting is located under:




  • Preferences


    • Profiles


      • [select a profile]


        • Keys












share|improve this answer



















  • 1





    I was looking for a reason to move to iTerm2 and here I have it. Thanks!!

    – Phani
    Sep 27 '13 at 17:32






  • 12





    May I ask why you choose to set option to "+Esc" and not to "Meta" when it sounds like you're trying to use Meta-keys? What is the difference / why is "+Esc" better? Thanks!

    – NHDaly
    Mar 1 '14 at 19:15



















21














For other folks who find their way here via their favorite search engine, I was able to solve this problem by simply going to Preferences -> Profiles -> Keyboard and checking "Use Option as Meta key" for the terminal profile I'm using.



I'm running weechat under tmux, and default key bindings make heavy use of the meta key.






share|improve this answer


























  • you save my day!

    – zx1986
    Feb 11 at 13:51



















3














I had the same problem and none of the answers provided here worked. That is, I too had the iTerm2 [Option] key remapped to [+Esc] (aka. "fallback"-[META]) in my "Preferences -> Profiles -> Keyboard", as described in the other answers, but still could not change my tmux pane layout with [CTRL]-[b], [+Esc/META]-[DIGIT].



Then I found that under "Preferences -> Keys", there is a "Navigation Shortcuts" where [Option] + (any) [DIGIT] is mapped to "switch split panes" (remember [Option] is remapped to [+Esc], so that's a clear collision). Therefore, after un-setting that (to an empty key value), I finally can again comfortably resize my tmux panes with [CTRL]-[b], [+Esc/META]-[DIGIT] (instead of having to use [CTRL]-[b], (the real) [Esc], and then the desired layout [DIGIT]).






share|improve this answer

































    0














    In my .zshrc I usually have the following set:



    bindkey '^[[1;9C' forward-word
    bindkey '^[[1;9D' backward-word


    Within tmux sessions, I had to additionally include



    bindkey '^[[1;3C' forward-word
    bindkey '^[[1;3D' backward-word


    You can figure out these codes by running read in a session, then pressing the keyboard shortcuts, e.g. Alt.



    My keys are set as follows in iTerm2:








    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "3"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f649960%2foption-key-does-not-work-as-meta-in-tmux%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      13














      I would suggest using iTerm2 instead of the default Terminal.app, as it is better for many reasons.



      Specifically, you would be interested in iTerm2's options to map left/right option as "+Esc", which works much better than trying to have it emulate Meta for every purpose I can think of or have tried.



      This setting is located under:




      • Preferences


        • Profiles


          • [select a profile]


            • Keys












      share|improve this answer



















      • 1





        I was looking for a reason to move to iTerm2 and here I have it. Thanks!!

        – Phani
        Sep 27 '13 at 17:32






      • 12





        May I ask why you choose to set option to "+Esc" and not to "Meta" when it sounds like you're trying to use Meta-keys? What is the difference / why is "+Esc" better? Thanks!

        – NHDaly
        Mar 1 '14 at 19:15
















      13














      I would suggest using iTerm2 instead of the default Terminal.app, as it is better for many reasons.



      Specifically, you would be interested in iTerm2's options to map left/right option as "+Esc", which works much better than trying to have it emulate Meta for every purpose I can think of or have tried.



      This setting is located under:




      • Preferences


        • Profiles


          • [select a profile]


            • Keys












      share|improve this answer



















      • 1





        I was looking for a reason to move to iTerm2 and here I have it. Thanks!!

        – Phani
        Sep 27 '13 at 17:32






      • 12





        May I ask why you choose to set option to "+Esc" and not to "Meta" when it sounds like you're trying to use Meta-keys? What is the difference / why is "+Esc" better? Thanks!

        – NHDaly
        Mar 1 '14 at 19:15














      13












      13








      13







      I would suggest using iTerm2 instead of the default Terminal.app, as it is better for many reasons.



      Specifically, you would be interested in iTerm2's options to map left/right option as "+Esc", which works much better than trying to have it emulate Meta for every purpose I can think of or have tried.



      This setting is located under:




      • Preferences


        • Profiles


          • [select a profile]


            • Keys












      share|improve this answer













      I would suggest using iTerm2 instead of the default Terminal.app, as it is better for many reasons.



      Specifically, you would be interested in iTerm2's options to map left/right option as "+Esc", which works much better than trying to have it emulate Meta for every purpose I can think of or have tried.



      This setting is located under:




      • Preferences


        • Profiles


          • [select a profile]


            • Keys













      share|improve this answer












      share|improve this answer



      share|improve this answer










      answered Sep 27 '13 at 2:34









      demuredemure

      4,01711526




      4,01711526








      • 1





        I was looking for a reason to move to iTerm2 and here I have it. Thanks!!

        – Phani
        Sep 27 '13 at 17:32






      • 12





        May I ask why you choose to set option to "+Esc" and not to "Meta" when it sounds like you're trying to use Meta-keys? What is the difference / why is "+Esc" better? Thanks!

        – NHDaly
        Mar 1 '14 at 19:15














      • 1





        I was looking for a reason to move to iTerm2 and here I have it. Thanks!!

        – Phani
        Sep 27 '13 at 17:32






      • 12





        May I ask why you choose to set option to "+Esc" and not to "Meta" when it sounds like you're trying to use Meta-keys? What is the difference / why is "+Esc" better? Thanks!

        – NHDaly
        Mar 1 '14 at 19:15








      1




      1





      I was looking for a reason to move to iTerm2 and here I have it. Thanks!!

      – Phani
      Sep 27 '13 at 17:32





      I was looking for a reason to move to iTerm2 and here I have it. Thanks!!

      – Phani
      Sep 27 '13 at 17:32




      12




      12





      May I ask why you choose to set option to "+Esc" and not to "Meta" when it sounds like you're trying to use Meta-keys? What is the difference / why is "+Esc" better? Thanks!

      – NHDaly
      Mar 1 '14 at 19:15





      May I ask why you choose to set option to "+Esc" and not to "Meta" when it sounds like you're trying to use Meta-keys? What is the difference / why is "+Esc" better? Thanks!

      – NHDaly
      Mar 1 '14 at 19:15













      21














      For other folks who find their way here via their favorite search engine, I was able to solve this problem by simply going to Preferences -> Profiles -> Keyboard and checking "Use Option as Meta key" for the terminal profile I'm using.



      I'm running weechat under tmux, and default key bindings make heavy use of the meta key.






      share|improve this answer


























      • you save my day!

        – zx1986
        Feb 11 at 13:51
















      21














      For other folks who find their way here via their favorite search engine, I was able to solve this problem by simply going to Preferences -> Profiles -> Keyboard and checking "Use Option as Meta key" for the terminal profile I'm using.



      I'm running weechat under tmux, and default key bindings make heavy use of the meta key.






      share|improve this answer


























      • you save my day!

        – zx1986
        Feb 11 at 13:51














      21












      21








      21







      For other folks who find their way here via their favorite search engine, I was able to solve this problem by simply going to Preferences -> Profiles -> Keyboard and checking "Use Option as Meta key" for the terminal profile I'm using.



      I'm running weechat under tmux, and default key bindings make heavy use of the meta key.






      share|improve this answer















      For other folks who find their way here via their favorite search engine, I was able to solve this problem by simply going to Preferences -> Profiles -> Keyboard and checking "Use Option as Meta key" for the terminal profile I'm using.



      I'm running weechat under tmux, and default key bindings make heavy use of the meta key.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Apr 23 '16 at 14:37

























      answered Aug 27 '15 at 1:37









      larskslarsks

      2,8821521




      2,8821521













      • you save my day!

        – zx1986
        Feb 11 at 13:51



















      • you save my day!

        – zx1986
        Feb 11 at 13:51

















      you save my day!

      – zx1986
      Feb 11 at 13:51





      you save my day!

      – zx1986
      Feb 11 at 13:51











      3














      I had the same problem and none of the answers provided here worked. That is, I too had the iTerm2 [Option] key remapped to [+Esc] (aka. "fallback"-[META]) in my "Preferences -> Profiles -> Keyboard", as described in the other answers, but still could not change my tmux pane layout with [CTRL]-[b], [+Esc/META]-[DIGIT].



      Then I found that under "Preferences -> Keys", there is a "Navigation Shortcuts" where [Option] + (any) [DIGIT] is mapped to "switch split panes" (remember [Option] is remapped to [+Esc], so that's a clear collision). Therefore, after un-setting that (to an empty key value), I finally can again comfortably resize my tmux panes with [CTRL]-[b], [+Esc/META]-[DIGIT] (instead of having to use [CTRL]-[b], (the real) [Esc], and then the desired layout [DIGIT]).






      share|improve this answer






























        3














        I had the same problem and none of the answers provided here worked. That is, I too had the iTerm2 [Option] key remapped to [+Esc] (aka. "fallback"-[META]) in my "Preferences -> Profiles -> Keyboard", as described in the other answers, but still could not change my tmux pane layout with [CTRL]-[b], [+Esc/META]-[DIGIT].



        Then I found that under "Preferences -> Keys", there is a "Navigation Shortcuts" where [Option] + (any) [DIGIT] is mapped to "switch split panes" (remember [Option] is remapped to [+Esc], so that's a clear collision). Therefore, after un-setting that (to an empty key value), I finally can again comfortably resize my tmux panes with [CTRL]-[b], [+Esc/META]-[DIGIT] (instead of having to use [CTRL]-[b], (the real) [Esc], and then the desired layout [DIGIT]).






        share|improve this answer




























          3












          3








          3







          I had the same problem and none of the answers provided here worked. That is, I too had the iTerm2 [Option] key remapped to [+Esc] (aka. "fallback"-[META]) in my "Preferences -> Profiles -> Keyboard", as described in the other answers, but still could not change my tmux pane layout with [CTRL]-[b], [+Esc/META]-[DIGIT].



          Then I found that under "Preferences -> Keys", there is a "Navigation Shortcuts" where [Option] + (any) [DIGIT] is mapped to "switch split panes" (remember [Option] is remapped to [+Esc], so that's a clear collision). Therefore, after un-setting that (to an empty key value), I finally can again comfortably resize my tmux panes with [CTRL]-[b], [+Esc/META]-[DIGIT] (instead of having to use [CTRL]-[b], (the real) [Esc], and then the desired layout [DIGIT]).






          share|improve this answer















          I had the same problem and none of the answers provided here worked. That is, I too had the iTerm2 [Option] key remapped to [+Esc] (aka. "fallback"-[META]) in my "Preferences -> Profiles -> Keyboard", as described in the other answers, but still could not change my tmux pane layout with [CTRL]-[b], [+Esc/META]-[DIGIT].



          Then I found that under "Preferences -> Keys", there is a "Navigation Shortcuts" where [Option] + (any) [DIGIT] is mapped to "switch split panes" (remember [Option] is remapped to [+Esc], so that's a clear collision). Therefore, after un-setting that (to an empty key value), I finally can again comfortably resize my tmux panes with [CTRL]-[b], [+Esc/META]-[DIGIT] (instead of having to use [CTRL]-[b], (the real) [Esc], and then the desired layout [DIGIT]).







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jun 15 '17 at 10:14

























          answered Jun 15 '17 at 10:09









          fnlfnl

          1314




          1314























              0














              In my .zshrc I usually have the following set:



              bindkey '^[[1;9C' forward-word
              bindkey '^[[1;9D' backward-word


              Within tmux sessions, I had to additionally include



              bindkey '^[[1;3C' forward-word
              bindkey '^[[1;3D' backward-word


              You can figure out these codes by running read in a session, then pressing the keyboard shortcuts, e.g. Alt.



              My keys are set as follows in iTerm2:








              share|improve this answer




























                0














                In my .zshrc I usually have the following set:



                bindkey '^[[1;9C' forward-word
                bindkey '^[[1;9D' backward-word


                Within tmux sessions, I had to additionally include



                bindkey '^[[1;3C' forward-word
                bindkey '^[[1;3D' backward-word


                You can figure out these codes by running read in a session, then pressing the keyboard shortcuts, e.g. Alt.



                My keys are set as follows in iTerm2:








                share|improve this answer


























                  0












                  0








                  0







                  In my .zshrc I usually have the following set:



                  bindkey '^[[1;9C' forward-word
                  bindkey '^[[1;9D' backward-word


                  Within tmux sessions, I had to additionally include



                  bindkey '^[[1;3C' forward-word
                  bindkey '^[[1;3D' backward-word


                  You can figure out these codes by running read in a session, then pressing the keyboard shortcuts, e.g. Alt.



                  My keys are set as follows in iTerm2:








                  share|improve this answer













                  In my .zshrc I usually have the following set:



                  bindkey '^[[1;9C' forward-word
                  bindkey '^[[1;9D' backward-word


                  Within tmux sessions, I had to additionally include



                  bindkey '^[[1;3C' forward-word
                  bindkey '^[[1;3D' backward-word


                  You can figure out these codes by running read in a session, then pressing the keyboard shortcuts, e.g. Alt.



                  My keys are set as follows in iTerm2:









                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Feb 7 at 13:48









                  slhckslhck

                  162k47448471




                  162k47448471






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Super User!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f649960%2foption-key-does-not-work-as-meta-in-tmux%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

                      Mangá

                      Eduardo VII do Reino Unido