Honestly I had no idea what ctrl+d even did, I just knew it was a convenient way for me to close all the REPL programs I use. The fact that it is similar to pressing enter really surprised me, so I wanted to share this knowledge with you :)

  • ramius345
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    2 days ago

    Ctrl+d terminates input on stdin to your currently running program or shell.

    • tuna@discuss.tchncs.deOP
      link
      fedilink
      arrow-up
      2
      arrow-down
      1
      ·
      2 days ago

      not true. try this:

      $ date<C-d>
      

      bash did not terminate stdin, because when i press enter it still runs the command, and my shell continues to work as normal!

      you can also try this:

      $ bash --noediting
      $ date<C-d><C-d>
      

      and it will print the date.

      so something else is happening here! thats what the link talks about in detail

      • ramius345
        link
        fedilink
        arrow-up
        2
        arrow-down
        1
        ·
        1 day ago

        For some reason my mobile client didn’t make the article link immediately obvious. That’s actually really interesting. Apparently I was under the same common misconception. So the shell in this case is choosing to continue after detecting the flush.