I don't think so... you are receiving the "echo" of your input, not the sketch output. You can verify it by adding
immediately before the line you already have:
and you will never see the hardcoded message... at least I didn't!
You are right, however, in which there is some Serial and Serial1 involved... since we are using "USB client port (not the audio like jack)"
... I'll keep trying and post if I find something...
Well, after working a little bit more, I found that:
a) serial1 is not related to anything in this case... the example works without any reference to serial1. And I've used a Gen1 Galileo with the USB client connected (not the serial console).
b) The code works if, as wbadry sent in his post, there is an explicit call to the serialEvent() function, since the Galileo "system" does not add any implicit one as in the Arduino "system".
c) There is not such thing as a char-by-char input, the whole input is available only when the "enter" key has been pressed and all the keys pressed (before the enter key, of course) are available, being \n the last one. I've checked this behavior with the Serial Monitor set to "New Line". I've not got to work other settings (not in a way I'm able to explain, anyway).
Summarizing: the example code in the IDE works (I'm using arduino-1.6.0+Intel, I don't know if there is some change in new IDEs) if you add an explicit call to serialEvent at the beginning or end of the loop function and the Serial Monitor is set to New Line.