0

It is common knowledge that on Linux to send EOF to a console program you press CTRLD while on Windows you press CTRLZ.

However I suspect that this is not actually a feature of the OS, but rather of the terminal or shell or ... maybe something else (like gnu readline).

So what (sub)system/program translates these keys into EOF?

bolov
  • 328
  • 1
  • 3
  • 17
  • The shell you are running. – DavidPostill Apr 07 '20 at 17:19
  • @DavidPostill Nah, it has nothing to do with the shell. It's the terminal – oguz ismail Apr 07 '20 at 17:19
  • @oguzismail Windows `cmd` is a shell. It happens to run in a terminal (sometimes). – DavidPostill Apr 07 '20 at 17:21
  • @DavidPostill the question is also about Unix; in Unix, *sh is the shell, and it has nothing to do with Ctrl+D. See [this Wikipedia article](https://en.m.wikipedia.org/wiki/End-of-Transmission_character#Meaning_in_Unix) – oguz ismail Apr 07 '20 at 17:24
  • It _still_ has nothing to do with the shell, because Cmd isn't the one performing this translation on Windows, either. – u1686_grawity Apr 08 '20 at 11:38
  • You may increase your chances for good answers by asking *separately* about the Windows mechanism and the Unix mechanism. My point is the current question requires a user who knows *both*. Users who know one xor another cannot create a good answer, unless they cooperate (community wiki?); they may step down. Or you may get two sets of half-answers. Separate questions would be on-topic here on Super User, still I expect [Unix&Linux SE](https://unix.stackexchange.com/) to answer the Unix part more thoroughly. If you decide to ask there, mind [this](https://meta.stackexchange.com/q/64068/355310). – Kamil Maciorowski Apr 09 '20 at 06:48

0 Answers0