add some code in Terminal.java