Adding a 'trigger' option to the cmd.run command in case of a foreground process to execute a callback based on a stdout match