Add compatibility write function to TermBuffer
fixed sgr-handler added basic sgr test
Fixing term modes