correct logic for determining whether there is a selection prior to code execution
control-enter to execute code in the console