The up arrow in the terminal should bring up the previous command. My terminal (including iTerm2 and Intellij IDEA terminal) shows ^[OA when I press the up arrow (↑).
If I press return, the previous command is still executed. It works fine and I can see the command if I press CTRL+C first.