Computer can send data to Arduino without serial monitor but arduino won't send

So I wrote a program on my computer to talk to the program I wrote on my Arduino Esplora over serial, it will gladly send the arduino information and the arduino will receive it, but the Arduino won’t send data to the computer (the TX light doesn’t even flash). After further investigation I noticed that if I write a program that continually sends serial data, the TX light doesn’t turn on at all until I open the serial monitor, then, the RX flashes for a sec and then TX comes on and the data appears in the serial monitor. It seems as though the serial monitor sends some kind of magic byte that tells the Arduino “hey I’m open so stop ignoring write commands please”. If someone knows what in the world that magic data is, it would be extremely helpful because this is very frustrating. In case your wondering the RX light also does flash and the TX light turns off as soon as the serial monitor closes.

Today at 07:58 pm
So I wrote a program on my computer to talk to the program I wrote on my Arduino Esplora over serial,

The Esplora is based on the Leonardo, and serial communications with the Leonardo can be confusing.

I think the answer is found in this thread after reply #5.

The Leonardo requires that DtrEnable be set when opening the serial connection (on the PC end). The Serial Monitor does that. Most PC applications do not

Thank you! Changed this and it worked perfectly.