Fixed some a connection bug and reduced flicker
Current bug with cursor that it jumps to the jast line in the history.
This version is untested (except the basic interface), why, because I'm feeling lazy, get over it.
I will probably test it later.