Why is my readline / .inputrc configuration being ignored?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I have a configuration line in my .inputrc:



set enable-bracketed-paste on # Insert paste as a string rather than possibly running it


This is valid when typed at the command line:



bind 'set enable-bracketed-paste on'


However the variable is not being set when I start bash v4.4.23.



Why is this line being ignored?










share|improve this question

























    up vote
    1
    down vote

    favorite












    I have a configuration line in my .inputrc:



    set enable-bracketed-paste on # Insert paste as a string rather than possibly running it


    This is valid when typed at the command line:



    bind 'set enable-bracketed-paste on'


    However the variable is not being set when I start bash v4.4.23.



    Why is this line being ignored?










    share|improve this question























      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I have a configuration line in my .inputrc:



      set enable-bracketed-paste on # Insert paste as a string rather than possibly running it


      This is valid when typed at the command line:



      bind 'set enable-bracketed-paste on'


      However the variable is not being set when I start bash v4.4.23.



      Why is this line being ignored?










      share|improve this question













      I have a configuration line in my .inputrc:



      set enable-bracketed-paste on # Insert paste as a string rather than possibly running it


      This is valid when typed at the command line:



      bind 'set enable-bracketed-paste on'


      However the variable is not being set when I start bash v4.4.23.



      Why is this line being ignored?







      readline inputrc






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 10 at 2:08









      Tom Hale

      6,47733186




      6,47733186




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          TL;DR:



          Put comments on separate lines to configuration.



          A comment at the end of a line causes readline to silently ignore the whole line if the line would otherwise be valid.




          The manual does say:



          Lines beginning with a ‘#’ are comments.


          It doesn't say that a comment will cause an otherwise valid config line to be ignored.



          This is strange, because the line:



          set foobar on # baz


          Results in:



          readline: /home/ravi/.config/readline/inputrc: line 34: foobar: unknown variable name


          Meaning that lines with a # at the end of them are indeed parsed for validity. They're just ignored if they would otherwise be valid.






          share|improve this answer




















          • Note that it says "lines beginning with #". A line not with a # at the start may not be a comment and the # and the text after it will be part of the value.
            – Kusalananda
            Dec 10 at 9:52







          • 1




            @Kusalananda I agree with you, but when setting a variable to on # blah when its valid values are either on or off some sort of error message would be helpful.
            – Tom Hale
            Dec 11 at 1:09


















          up vote
          1
          down vote













          The parser for readline doesn't seem to be that good:



           $ bind 'set "enable-bracketed-paste" "on" '; echo $?; bind -v | grep 'bracketed'
          0
          readline: "enable-bracketed-paste": unknown variable name

          $ bind 'set enable-bracketed-paste "on" '; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste off

          $ bind 'set enable-bracketed-paste on '; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste on

          $ bind 'set enable-bracketed-paste on .'; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste off


          It seems that any string after an option is seen as part of the option (maybe?).



          The manual states that comments are only at the start of the line, so, I recommend you to stick to that rule. Instead, use:



           # Insert paste as a string rather than possibly running it
          set enable-bracketed-paste on





          share|improve this answer




















          • From the last example it seems that anything invalid will return the value to the default value.
            – Tom Hale
            Dec 11 at 9:34










          • Well, yes, for the enable-bracketed-paste option, but that is not the case for set bell-style off for example, it stays at the previous value when the line is not understood by readline, not falling to a default value. @TomHale
            – Isaac
            Dec 11 at 9:38











          • readline: now with added randomness for increased surprises!
            – Tom Hale
            Dec 11 at 10:48










          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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%2funix.stackexchange.com%2fquestions%2f487037%2fwhy-is-my-readline-inputrc-configuration-being-ignored%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote



          accepted










          TL;DR:



          Put comments on separate lines to configuration.



          A comment at the end of a line causes readline to silently ignore the whole line if the line would otherwise be valid.




          The manual does say:



          Lines beginning with a ‘#’ are comments.


          It doesn't say that a comment will cause an otherwise valid config line to be ignored.



          This is strange, because the line:



          set foobar on # baz


          Results in:



          readline: /home/ravi/.config/readline/inputrc: line 34: foobar: unknown variable name


          Meaning that lines with a # at the end of them are indeed parsed for validity. They're just ignored if they would otherwise be valid.






          share|improve this answer




















          • Note that it says "lines beginning with #". A line not with a # at the start may not be a comment and the # and the text after it will be part of the value.
            – Kusalananda
            Dec 10 at 9:52







          • 1




            @Kusalananda I agree with you, but when setting a variable to on # blah when its valid values are either on or off some sort of error message would be helpful.
            – Tom Hale
            Dec 11 at 1:09















          up vote
          1
          down vote



          accepted










          TL;DR:



          Put comments on separate lines to configuration.



          A comment at the end of a line causes readline to silently ignore the whole line if the line would otherwise be valid.




          The manual does say:



          Lines beginning with a ‘#’ are comments.


          It doesn't say that a comment will cause an otherwise valid config line to be ignored.



          This is strange, because the line:



          set foobar on # baz


          Results in:



          readline: /home/ravi/.config/readline/inputrc: line 34: foobar: unknown variable name


          Meaning that lines with a # at the end of them are indeed parsed for validity. They're just ignored if they would otherwise be valid.






          share|improve this answer




















          • Note that it says "lines beginning with #". A line not with a # at the start may not be a comment and the # and the text after it will be part of the value.
            – Kusalananda
            Dec 10 at 9:52







          • 1




            @Kusalananda I agree with you, but when setting a variable to on # blah when its valid values are either on or off some sort of error message would be helpful.
            – Tom Hale
            Dec 11 at 1:09













          up vote
          1
          down vote



          accepted







          up vote
          1
          down vote



          accepted






          TL;DR:



          Put comments on separate lines to configuration.



          A comment at the end of a line causes readline to silently ignore the whole line if the line would otherwise be valid.




          The manual does say:



          Lines beginning with a ‘#’ are comments.


          It doesn't say that a comment will cause an otherwise valid config line to be ignored.



          This is strange, because the line:



          set foobar on # baz


          Results in:



          readline: /home/ravi/.config/readline/inputrc: line 34: foobar: unknown variable name


          Meaning that lines with a # at the end of them are indeed parsed for validity. They're just ignored if they would otherwise be valid.






          share|improve this answer












          TL;DR:



          Put comments on separate lines to configuration.



          A comment at the end of a line causes readline to silently ignore the whole line if the line would otherwise be valid.




          The manual does say:



          Lines beginning with a ‘#’ are comments.


          It doesn't say that a comment will cause an otherwise valid config line to be ignored.



          This is strange, because the line:



          set foobar on # baz


          Results in:



          readline: /home/ravi/.config/readline/inputrc: line 34: foobar: unknown variable name


          Meaning that lines with a # at the end of them are indeed parsed for validity. They're just ignored if they would otherwise be valid.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 10 at 2:08









          Tom Hale

          6,47733186




          6,47733186











          • Note that it says "lines beginning with #". A line not with a # at the start may not be a comment and the # and the text after it will be part of the value.
            – Kusalananda
            Dec 10 at 9:52







          • 1




            @Kusalananda I agree with you, but when setting a variable to on # blah when its valid values are either on or off some sort of error message would be helpful.
            – Tom Hale
            Dec 11 at 1:09

















          • Note that it says "lines beginning with #". A line not with a # at the start may not be a comment and the # and the text after it will be part of the value.
            – Kusalananda
            Dec 10 at 9:52







          • 1




            @Kusalananda I agree with you, but when setting a variable to on # blah when its valid values are either on or off some sort of error message would be helpful.
            – Tom Hale
            Dec 11 at 1:09
















          Note that it says "lines beginning with #". A line not with a # at the start may not be a comment and the # and the text after it will be part of the value.
          – Kusalananda
          Dec 10 at 9:52





          Note that it says "lines beginning with #". A line not with a # at the start may not be a comment and the # and the text after it will be part of the value.
          – Kusalananda
          Dec 10 at 9:52





          1




          1




          @Kusalananda I agree with you, but when setting a variable to on # blah when its valid values are either on or off some sort of error message would be helpful.
          – Tom Hale
          Dec 11 at 1:09





          @Kusalananda I agree with you, but when setting a variable to on # blah when its valid values are either on or off some sort of error message would be helpful.
          – Tom Hale
          Dec 11 at 1:09













          up vote
          1
          down vote













          The parser for readline doesn't seem to be that good:



           $ bind 'set "enable-bracketed-paste" "on" '; echo $?; bind -v | grep 'bracketed'
          0
          readline: "enable-bracketed-paste": unknown variable name

          $ bind 'set enable-bracketed-paste "on" '; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste off

          $ bind 'set enable-bracketed-paste on '; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste on

          $ bind 'set enable-bracketed-paste on .'; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste off


          It seems that any string after an option is seen as part of the option (maybe?).



          The manual states that comments are only at the start of the line, so, I recommend you to stick to that rule. Instead, use:



           # Insert paste as a string rather than possibly running it
          set enable-bracketed-paste on





          share|improve this answer




















          • From the last example it seems that anything invalid will return the value to the default value.
            – Tom Hale
            Dec 11 at 9:34










          • Well, yes, for the enable-bracketed-paste option, but that is not the case for set bell-style off for example, it stays at the previous value when the line is not understood by readline, not falling to a default value. @TomHale
            – Isaac
            Dec 11 at 9:38











          • readline: now with added randomness for increased surprises!
            – Tom Hale
            Dec 11 at 10:48














          up vote
          1
          down vote













          The parser for readline doesn't seem to be that good:



           $ bind 'set "enable-bracketed-paste" "on" '; echo $?; bind -v | grep 'bracketed'
          0
          readline: "enable-bracketed-paste": unknown variable name

          $ bind 'set enable-bracketed-paste "on" '; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste off

          $ bind 'set enable-bracketed-paste on '; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste on

          $ bind 'set enable-bracketed-paste on .'; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste off


          It seems that any string after an option is seen as part of the option (maybe?).



          The manual states that comments are only at the start of the line, so, I recommend you to stick to that rule. Instead, use:



           # Insert paste as a string rather than possibly running it
          set enable-bracketed-paste on





          share|improve this answer




















          • From the last example it seems that anything invalid will return the value to the default value.
            – Tom Hale
            Dec 11 at 9:34










          • Well, yes, for the enable-bracketed-paste option, but that is not the case for set bell-style off for example, it stays at the previous value when the line is not understood by readline, not falling to a default value. @TomHale
            – Isaac
            Dec 11 at 9:38











          • readline: now with added randomness for increased surprises!
            – Tom Hale
            Dec 11 at 10:48












          up vote
          1
          down vote










          up vote
          1
          down vote









          The parser for readline doesn't seem to be that good:



           $ bind 'set "enable-bracketed-paste" "on" '; echo $?; bind -v | grep 'bracketed'
          0
          readline: "enable-bracketed-paste": unknown variable name

          $ bind 'set enable-bracketed-paste "on" '; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste off

          $ bind 'set enable-bracketed-paste on '; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste on

          $ bind 'set enable-bracketed-paste on .'; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste off


          It seems that any string after an option is seen as part of the option (maybe?).



          The manual states that comments are only at the start of the line, so, I recommend you to stick to that rule. Instead, use:



           # Insert paste as a string rather than possibly running it
          set enable-bracketed-paste on





          share|improve this answer












          The parser for readline doesn't seem to be that good:



           $ bind 'set "enable-bracketed-paste" "on" '; echo $?; bind -v | grep 'bracketed'
          0
          readline: "enable-bracketed-paste": unknown variable name

          $ bind 'set enable-bracketed-paste "on" '; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste off

          $ bind 'set enable-bracketed-paste on '; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste on

          $ bind 'set enable-bracketed-paste on .'; echo $?; bind -v | grep 'bracketed'
          0
          set enable-bracketed-paste off


          It seems that any string after an option is seen as part of the option (maybe?).



          The manual states that comments are only at the start of the line, so, I recommend you to stick to that rule. Instead, use:



           # Insert paste as a string rather than possibly running it
          set enable-bracketed-paste on






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 11 at 8:28









          Isaac

          11k11648




          11k11648











          • From the last example it seems that anything invalid will return the value to the default value.
            – Tom Hale
            Dec 11 at 9:34










          • Well, yes, for the enable-bracketed-paste option, but that is not the case for set bell-style off for example, it stays at the previous value when the line is not understood by readline, not falling to a default value. @TomHale
            – Isaac
            Dec 11 at 9:38











          • readline: now with added randomness for increased surprises!
            – Tom Hale
            Dec 11 at 10:48
















          • From the last example it seems that anything invalid will return the value to the default value.
            – Tom Hale
            Dec 11 at 9:34










          • Well, yes, for the enable-bracketed-paste option, but that is not the case for set bell-style off for example, it stays at the previous value when the line is not understood by readline, not falling to a default value. @TomHale
            – Isaac
            Dec 11 at 9:38











          • readline: now with added randomness for increased surprises!
            – Tom Hale
            Dec 11 at 10:48















          From the last example it seems that anything invalid will return the value to the default value.
          – Tom Hale
          Dec 11 at 9:34




          From the last example it seems that anything invalid will return the value to the default value.
          – Tom Hale
          Dec 11 at 9:34












          Well, yes, for the enable-bracketed-paste option, but that is not the case for set bell-style off for example, it stays at the previous value when the line is not understood by readline, not falling to a default value. @TomHale
          – Isaac
          Dec 11 at 9:38





          Well, yes, for the enable-bracketed-paste option, but that is not the case for set bell-style off for example, it stays at the previous value when the line is not understood by readline, not falling to a default value. @TomHale
          – Isaac
          Dec 11 at 9:38













          readline: now with added randomness for increased surprises!
          – Tom Hale
          Dec 11 at 10:48




          readline: now with added randomness for increased surprises!
          – Tom Hale
          Dec 11 at 10:48

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • 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.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • 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%2funix.stackexchange.com%2fquestions%2f487037%2fwhy-is-my-readline-inputrc-configuration-being-ignored%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 to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay