refactor(terminal) addListeners