reference counting on a terminal