Attached is my simple trial for CY8CKIT-046.
But as I don't have CY8CKIT-046, I could not test it, but at least it compiles.
Please let me know if this works for your board.
Note: I use only '\n' for new line as I like the Unix way and I set TeraTerm's
Menu Setup > Terminal setup > New-Line > Receive : AUTO.
If you like Wintel way (having CR+LF) please change and add \r after \n. ("\n" -> "\n\r")