Understanding control characters in .inputrc












20















My Linux account in a remote machine comes with the following pre-defined .inputrc



"e[1~": beginning-of-line
"e[4~": end-of-line
“e[5~”: history-search-backward
“e[6~”: history-search-forward
"e[3~": delete-char
"e[2~": quoted-insert
"e[5C": forward-word
"e[5D": backward-word
"ee[C": forward-word
"ee[D": backward-word

set completion-ignore-case on
set bell-style visible
set expand-tilde on
set convert-meta off
set input-meta on
set output-meta on
set show-all-if-ambiguous on
set visible-stats on


I am reading the GNU bash documentation on the topic, but I haven't been able to find a section explaining what the character sequences e[1~, e[5C, ee[D, etc. mean.



I think I read somewhere that e means the meta character (which I think is Alt in my keyboard), but don't understand what the other control characters [, ~, 5D etc. mean.



Anybody knows of a good reference on the topic?










share|improve this question



























    20















    My Linux account in a remote machine comes with the following pre-defined .inputrc



    "e[1~": beginning-of-line
    "e[4~": end-of-line
    “e[5~”: history-search-backward
    “e[6~”: history-search-forward
    "e[3~": delete-char
    "e[2~": quoted-insert
    "e[5C": forward-word
    "e[5D": backward-word
    "ee[C": forward-word
    "ee[D": backward-word

    set completion-ignore-case on
    set bell-style visible
    set expand-tilde on
    set convert-meta off
    set input-meta on
    set output-meta on
    set show-all-if-ambiguous on
    set visible-stats on


    I am reading the GNU bash documentation on the topic, but I haven't been able to find a section explaining what the character sequences e[1~, e[5C, ee[D, etc. mean.



    I think I read somewhere that e means the meta character (which I think is Alt in my keyboard), but don't understand what the other control characters [, ~, 5D etc. mean.



    Anybody knows of a good reference on the topic?










    share|improve this question

























      20












      20








      20


      8






      My Linux account in a remote machine comes with the following pre-defined .inputrc



      "e[1~": beginning-of-line
      "e[4~": end-of-line
      “e[5~”: history-search-backward
      “e[6~”: history-search-forward
      "e[3~": delete-char
      "e[2~": quoted-insert
      "e[5C": forward-word
      "e[5D": backward-word
      "ee[C": forward-word
      "ee[D": backward-word

      set completion-ignore-case on
      set bell-style visible
      set expand-tilde on
      set convert-meta off
      set input-meta on
      set output-meta on
      set show-all-if-ambiguous on
      set visible-stats on


      I am reading the GNU bash documentation on the topic, but I haven't been able to find a section explaining what the character sequences e[1~, e[5C, ee[D, etc. mean.



      I think I read somewhere that e means the meta character (which I think is Alt in my keyboard), but don't understand what the other control characters [, ~, 5D etc. mean.



      Anybody knows of a good reference on the topic?










      share|improve this question














      My Linux account in a remote machine comes with the following pre-defined .inputrc



      "e[1~": beginning-of-line
      "e[4~": end-of-line
      “e[5~”: history-search-backward
      “e[6~”: history-search-forward
      "e[3~": delete-char
      "e[2~": quoted-insert
      "e[5C": forward-word
      "e[5D": backward-word
      "ee[C": forward-word
      "ee[D": backward-word

      set completion-ignore-case on
      set bell-style visible
      set expand-tilde on
      set convert-meta off
      set input-meta on
      set output-meta on
      set show-all-if-ambiguous on
      set visible-stats on


      I am reading the GNU bash documentation on the topic, but I haven't been able to find a section explaining what the character sequences e[1~, e[5C, ee[D, etc. mean.



      I think I read somewhere that e means the meta character (which I think is Alt in my keyboard), but don't understand what the other control characters [, ~, 5D etc. mean.



      Anybody knows of a good reference on the topic?







      bash inputrc






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Apr 11 '11 at 15:00









      Amelio Vazquez-ReinaAmelio Vazquez-Reina

      2,711165174




      2,711165174






















          1 Answer
          1






          active

          oldest

          votes


















          20














          These are ANSI control-code escape sequences that are transmitted when various non alphanumeric keys are pressed on a "terminal" keyboard.



          e means the ASCII "ESCAPE" character (octal 033 hex 1B decimal 27). Which is part of a command sequence
          introduction (CSI).



          Escape [ 2 ~ is a character sequence transmitted when you press the key labelled "Insert" on a VT220 (or later) terminal.



          Many of these conventions have been adopted in software such as xterm and Linux consoles / shells - often extended in various, sometimes incompatible ways.



          The use of these sequences in bash's READLINE function is described in the man pages for readline




          In the second form, "keyseq":function-name or macro, keyseq differs
          from keyname above in that strings denoting an entire key sequence may
          be specified by placing the sequence within double quotes. Some GNU
          Emacs style key escapes can be used, as in the following example, but
          the symbolic character names are not recognized.

          "C-u": universal-argument
          "C-xC-r": re-read-init-file
          "e[11~": "Function Key 1"



          To get a list of which escape sequences correspond to which keyboard-keys, you can use a command such as infocmp -L -1 or infocmp -L -1 xterm






          share|improve this answer


























          • Excellent!! That's exactly what I was looking for. Thanks @RedGrittyBrick!

            – Amelio Vazquez-Reina
            Apr 11 '11 at 15:41













          • +1. I was looking for Ctrl code in inputrc --> ENTER = Ctrl + n.

            – rendon
            Aug 17 '13 at 17:22











          • @user1133275: link updated but the command man 3 readline on your own system should give you the same information. The command man 3 readlinealso works in WSL on WIndows 10. IF necessary you can ask a new question about the specific parts of bind -P output that are causing you difficulty.

            – RedGrittyBrick
            Mar 1 at 9:42














          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%2f269464%2funderstanding-control-characters-in-inputrc%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          20














          These are ANSI control-code escape sequences that are transmitted when various non alphanumeric keys are pressed on a "terminal" keyboard.



          e means the ASCII "ESCAPE" character (octal 033 hex 1B decimal 27). Which is part of a command sequence
          introduction (CSI).



          Escape [ 2 ~ is a character sequence transmitted when you press the key labelled "Insert" on a VT220 (or later) terminal.



          Many of these conventions have been adopted in software such as xterm and Linux consoles / shells - often extended in various, sometimes incompatible ways.



          The use of these sequences in bash's READLINE function is described in the man pages for readline




          In the second form, "keyseq":function-name or macro, keyseq differs
          from keyname above in that strings denoting an entire key sequence may
          be specified by placing the sequence within double quotes. Some GNU
          Emacs style key escapes can be used, as in the following example, but
          the symbolic character names are not recognized.

          "C-u": universal-argument
          "C-xC-r": re-read-init-file
          "e[11~": "Function Key 1"



          To get a list of which escape sequences correspond to which keyboard-keys, you can use a command such as infocmp -L -1 or infocmp -L -1 xterm






          share|improve this answer


























          • Excellent!! That's exactly what I was looking for. Thanks @RedGrittyBrick!

            – Amelio Vazquez-Reina
            Apr 11 '11 at 15:41













          • +1. I was looking for Ctrl code in inputrc --> ENTER = Ctrl + n.

            – rendon
            Aug 17 '13 at 17:22











          • @user1133275: link updated but the command man 3 readline on your own system should give you the same information. The command man 3 readlinealso works in WSL on WIndows 10. IF necessary you can ask a new question about the specific parts of bind -P output that are causing you difficulty.

            – RedGrittyBrick
            Mar 1 at 9:42


















          20














          These are ANSI control-code escape sequences that are transmitted when various non alphanumeric keys are pressed on a "terminal" keyboard.



          e means the ASCII "ESCAPE" character (octal 033 hex 1B decimal 27). Which is part of a command sequence
          introduction (CSI).



          Escape [ 2 ~ is a character sequence transmitted when you press the key labelled "Insert" on a VT220 (or later) terminal.



          Many of these conventions have been adopted in software such as xterm and Linux consoles / shells - often extended in various, sometimes incompatible ways.



          The use of these sequences in bash's READLINE function is described in the man pages for readline




          In the second form, "keyseq":function-name or macro, keyseq differs
          from keyname above in that strings denoting an entire key sequence may
          be specified by placing the sequence within double quotes. Some GNU
          Emacs style key escapes can be used, as in the following example, but
          the symbolic character names are not recognized.

          "C-u": universal-argument
          "C-xC-r": re-read-init-file
          "e[11~": "Function Key 1"



          To get a list of which escape sequences correspond to which keyboard-keys, you can use a command such as infocmp -L -1 or infocmp -L -1 xterm






          share|improve this answer


























          • Excellent!! That's exactly what I was looking for. Thanks @RedGrittyBrick!

            – Amelio Vazquez-Reina
            Apr 11 '11 at 15:41













          • +1. I was looking for Ctrl code in inputrc --> ENTER = Ctrl + n.

            – rendon
            Aug 17 '13 at 17:22











          • @user1133275: link updated but the command man 3 readline on your own system should give you the same information. The command man 3 readlinealso works in WSL on WIndows 10. IF necessary you can ask a new question about the specific parts of bind -P output that are causing you difficulty.

            – RedGrittyBrick
            Mar 1 at 9:42
















          20












          20








          20







          These are ANSI control-code escape sequences that are transmitted when various non alphanumeric keys are pressed on a "terminal" keyboard.



          e means the ASCII "ESCAPE" character (octal 033 hex 1B decimal 27). Which is part of a command sequence
          introduction (CSI).



          Escape [ 2 ~ is a character sequence transmitted when you press the key labelled "Insert" on a VT220 (or later) terminal.



          Many of these conventions have been adopted in software such as xterm and Linux consoles / shells - often extended in various, sometimes incompatible ways.



          The use of these sequences in bash's READLINE function is described in the man pages for readline




          In the second form, "keyseq":function-name or macro, keyseq differs
          from keyname above in that strings denoting an entire key sequence may
          be specified by placing the sequence within double quotes. Some GNU
          Emacs style key escapes can be used, as in the following example, but
          the symbolic character names are not recognized.

          "C-u": universal-argument
          "C-xC-r": re-read-init-file
          "e[11~": "Function Key 1"



          To get a list of which escape sequences correspond to which keyboard-keys, you can use a command such as infocmp -L -1 or infocmp -L -1 xterm






          share|improve this answer















          These are ANSI control-code escape sequences that are transmitted when various non alphanumeric keys are pressed on a "terminal" keyboard.



          e means the ASCII "ESCAPE" character (octal 033 hex 1B decimal 27). Which is part of a command sequence
          introduction (CSI).



          Escape [ 2 ~ is a character sequence transmitted when you press the key labelled "Insert" on a VT220 (or later) terminal.



          Many of these conventions have been adopted in software such as xterm and Linux consoles / shells - often extended in various, sometimes incompatible ways.



          The use of these sequences in bash's READLINE function is described in the man pages for readline




          In the second form, "keyseq":function-name or macro, keyseq differs
          from keyname above in that strings denoting an entire key sequence may
          be specified by placing the sequence within double quotes. Some GNU
          Emacs style key escapes can be used, as in the following example, but
          the symbolic character names are not recognized.

          "C-u": universal-argument
          "C-xC-r": re-read-init-file
          "e[11~": "Function Key 1"



          To get a list of which escape sequences correspond to which keyboard-keys, you can use a command such as infocmp -L -1 or infocmp -L -1 xterm







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Mar 1 at 10:25

























          answered Apr 11 '11 at 15:21









          RedGrittyBrickRedGrittyBrick

          67.4k13106163




          67.4k13106163













          • Excellent!! That's exactly what I was looking for. Thanks @RedGrittyBrick!

            – Amelio Vazquez-Reina
            Apr 11 '11 at 15:41













          • +1. I was looking for Ctrl code in inputrc --> ENTER = Ctrl + n.

            – rendon
            Aug 17 '13 at 17:22











          • @user1133275: link updated but the command man 3 readline on your own system should give you the same information. The command man 3 readlinealso works in WSL on WIndows 10. IF necessary you can ask a new question about the specific parts of bind -P output that are causing you difficulty.

            – RedGrittyBrick
            Mar 1 at 9:42





















          • Excellent!! That's exactly what I was looking for. Thanks @RedGrittyBrick!

            – Amelio Vazquez-Reina
            Apr 11 '11 at 15:41













          • +1. I was looking for Ctrl code in inputrc --> ENTER = Ctrl + n.

            – rendon
            Aug 17 '13 at 17:22











          • @user1133275: link updated but the command man 3 readline on your own system should give you the same information. The command man 3 readlinealso works in WSL on WIndows 10. IF necessary you can ask a new question about the specific parts of bind -P output that are causing you difficulty.

            – RedGrittyBrick
            Mar 1 at 9:42



















          Excellent!! That's exactly what I was looking for. Thanks @RedGrittyBrick!

          – Amelio Vazquez-Reina
          Apr 11 '11 at 15:41







          Excellent!! That's exactly what I was looking for. Thanks @RedGrittyBrick!

          – Amelio Vazquez-Reina
          Apr 11 '11 at 15:41















          +1. I was looking for Ctrl code in inputrc --> ENTER = Ctrl + n.

          – rendon
          Aug 17 '13 at 17:22





          +1. I was looking for Ctrl code in inputrc --> ENTER = Ctrl + n.

          – rendon
          Aug 17 '13 at 17:22













          @user1133275: link updated but the command man 3 readline on your own system should give you the same information. The command man 3 readlinealso works in WSL on WIndows 10. IF necessary you can ask a new question about the specific parts of bind -P output that are causing you difficulty.

          – RedGrittyBrick
          Mar 1 at 9:42







          @user1133275: link updated but the command man 3 readline on your own system should give you the same information. The command man 3 readlinealso works in WSL on WIndows 10. IF necessary you can ask a new question about the specific parts of bind -P output that are causing you difficulty.

          – RedGrittyBrick
          Mar 1 at 9:42




















          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%2f269464%2funderstanding-control-characters-in-inputrc%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

          How do I know what Microsoft account the skydrive app is syncing to?

          When does type information flow backwards in C++?

          Grease: Live!