bugfix selecting window when shell close
add save-buffers-kill-processes-and-terminal
add flycheck and tex and improve auto compile