CrazyCoder’s comment is the right way to go.
I just formalize his comment as an answer here.
Step1: Go to Run —> Edit Configurations

Step2: Check the option: Emulate terminal in output console

VoilĂ
