fix accessing current terminal

use `current terminal` instead of `first terminal` to access current terminal