Implement the 'wait' command.