Complete terminal plugin.  Fix bugs.