document more of the terminal code