fix term mode error and and auto indention support