Terminal fixes

added backspace
limited number of lines on textbox
keep caret to end on \n