Some bug fixes
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.
Revert "Fixed some a connection bug and reduced flicker"

This reverts commit c8fc7baceda6f8477b505da1673b58ae5df69061.
Accidentally pushed to both branches