Added support for resizing terminal.