Fixed a bug with the command handler and added a function that launches a command in a new terminal window