• mina86OP
    link
    fedilink
    arrow-up
    9
    ·
    2 days ago

    Yes. So is Ctrl+J actually. Ctrl+J corresponds to line feed (LF) and Ctrl+M corresponds to carriage return (CR) ASCII characters. They are typically treated the same way.

    • pmk@lemmy.sdf.org
      link
      fedilink
      arrow-up
      8
      arrow-down
      1
      ·
      edit-2
      2 days ago

      Found it in the classic The UNIX Programming Environment from 1984:

      But then, this is for return, which technically isn’t “enter”, but nowadays they are sort of interpreted the same by programs?

      • mina86OP
        link
        fedilink
        English
        arrow-up
        4
        ·
        edit-2
        2 days ago

        Yeah, it’s a bit philosophical.

        • In graphical applications, Ctrl+M, Ctrl+J and Return/Enter are all different things.
        • In a terminal in raw mode, Ctrl+M and Return/Enter are the same thing but Ctrl+J is something different. You can for example run bind -x '"\C-j":"echo a"' in bash and Ctrl+J will do something different.
        • In a terminal in canonical mode, they are all the same thing. There probably are some stty options which can change that though.