fix term-mode