It’s worse than just up/down. You don’t even get left/right. Windows provides a line editor when you call functions like scanf(). This makes it easier to write interactive CLI programs. You don’t get that on macOS or Linux (or any other system; only Windows does this AFAIK.)
You need to implement your own line editor (which might be difficult if you’re not familiar with Unix terminal standards,) or use an existing one like readline (GPL licensed) or libedit (BSD licensed.)
Sorry for the bump, just saw this on suggested topics and thought it might be useful to someone.
Generally on Linux people use rlwrap for stuff like this – just pass the usual commands for launching the game as arguments to rlwrap and it magically works. History is automatically preserved in between sessions, which is nice.
Also works well on Windows consoles that are not cmd.exe (like Cygwin console or WSL’s conhost).