pull out terminal code into term pkg