TerminalWidget: allow pty to be set after creating object

This will be required by the upcoming commandDialog.
Added CommandDialog

CommandDialog reads the command and arguments from the dialog arguments and
executes it in the given pty.