dealing with terminal control