Handling selection in shell.