If I am in the last line of Terminal.app and enter a long command, it does not create new line, but instead overwrites the same line.
How can I solve this bug?
I have a hunch that this is primarily caused by your accented characters (çã) in your directory name, because this is not a problem by default:
Special characters, unprintable or otherwise, frequently cause problems with classic terminals / shells.
Try opening a new terminal tab/window, and see if this problem occurs immediately, or if it doesn't occur until after you enter a directory with special characters.