term-mode improvements