How to bind a keyboard shortcut in zsh to a program requiring stdin?

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











up vote
0
down vote

favorite












This is a follow-up to this question: I'm trying to create a keyboard shortcut for the terminal file manager ranger, in order to jump from the zsh prompt into the file manager with a single keystroke. I was following the linked answer, adding this to my .zshrc:



run_ranger () echo; ranger; zle redisplay 
zle -N run_ranger
bindkey '^f' run_ranger


The key binding itself works, however ranger fails to start with Error: Must run ranger from terminal. I had a look at the ranger code (Python) and it performs the common check sys.stdin.isatty() to verify that is has a TTY stdin. How can I modify the zle widget so that stdin is properly set?









share

























    up vote
    0
    down vote

    favorite












    This is a follow-up to this question: I'm trying to create a keyboard shortcut for the terminal file manager ranger, in order to jump from the zsh prompt into the file manager with a single keystroke. I was following the linked answer, adding this to my .zshrc:



    run_ranger () echo; ranger; zle redisplay 
    zle -N run_ranger
    bindkey '^f' run_ranger


    The key binding itself works, however ranger fails to start with Error: Must run ranger from terminal. I had a look at the ranger code (Python) and it performs the common check sys.stdin.isatty() to verify that is has a TTY stdin. How can I modify the zle widget so that stdin is properly set?









    share























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      This is a follow-up to this question: I'm trying to create a keyboard shortcut for the terminal file manager ranger, in order to jump from the zsh prompt into the file manager with a single keystroke. I was following the linked answer, adding this to my .zshrc:



      run_ranger () echo; ranger; zle redisplay 
      zle -N run_ranger
      bindkey '^f' run_ranger


      The key binding itself works, however ranger fails to start with Error: Must run ranger from terminal. I had a look at the ranger code (Python) and it performs the common check sys.stdin.isatty() to verify that is has a TTY stdin. How can I modify the zle widget so that stdin is properly set?









      share













      This is a follow-up to this question: I'm trying to create a keyboard shortcut for the terminal file manager ranger, in order to jump from the zsh prompt into the file manager with a single keystroke. I was following the linked answer, adding this to my .zshrc:



      run_ranger () echo; ranger; zle redisplay 
      zle -N run_ranger
      bindkey '^f' run_ranger


      The key binding itself works, however ranger fails to start with Error: Must run ranger from terminal. I had a look at the ranger code (Python) and it performs the common check sys.stdin.isatty() to verify that is has a TTY stdin. How can I modify the zle widget so that stdin is properly set?







      zsh keyboard-shortcuts ranger zle





      share












      share










      share



      share










      asked 1 min ago









      bluenote10

      1113




      1113

























          active

          oldest

          votes











          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',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          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%2f475310%2fhow-to-bind-a-keyboard-shortcut-in-zsh-to-a-program-requiring-stdin%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f475310%2fhow-to-bind-a-keyboard-shortcut-in-zsh-to-a-program-requiring-stdin%23new-answer', 'question_page');

          );

          Post as a guest













































































          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