Add onFirstFocus event to TTY module
Replace line.dirty property with some methods