I press Ctrl+D to end standard input, but it only works if I'm on a fresh line. And that requires me to push Enter first, which puts an unwanted new line character in there. Is there any way around that?
Normally, you press Enter after input, and it reverse that line:
But if you do not want to append a newline to your input, just press
Also, different programs handles this differently, for example