---
name: ✨ Feature request
about: Suggest an idea for this project
---
<!--- Verify first that your feature was not already discussed on GitHub -->
<!--- Complete *all* sections as described, this form is processed automatically -->

##### SUMMARY
<!--- Describe the new feature/improvement briefly below -->

Leave an exit message when catching `KeyboardInterrupt` in ansible/lib/console


##### ISSUE TYPE
- Feature Idea

##### COMPONENT NAME
<!--- Write the short name of the module, plugin, task or feature below, use your best guess if unsure -->

`ansible/lib/ansible/cli/console.py`



##### ADDITIONAL INFORMATION
<!--- Describe how the feature would be used, why it is needed and what it would solve -->

https://github.com/ansible/ansible/blob/0f5a63f1b99e586f86932907c49b1e8877128957/lib/ansible/cli/console.py#L112

`ansible-console` catches KeyboardInterrupt silently.

This may confuse new users, and a simple 'Exiting REPL!' before that `self.do_exit` would probably be helpful for someone trying the REPL for the first time.

I'll admit I was confused and didn't even realize I was back in my normal shell at first.

Alternatively, if this behavior could be made configurable with something as simple as a class or instance attribute or something that would amazing.

<!--- Paste example playbooks or commands between quotes below -->
```yaml

```

<!--- HINT: You can also paste gist.github.com links for larger files -->


mline = line.partition(' ')[2]
        offs = len(mline) - len(text)
        if self.cwd in ('all', '*', '\\'):
            completions = self.hosts + self.groups
        else:
            completions = [x.name for x in self.inventory.list_hosts(self.cwd)]
        return [to_native(s)[offs:] for s in completions if to_native(s).startswith(to_native(mline))]
    def completedefault(self, text, line, begidx, endidx):
        if line.split()[0] in self.modules:
            mline = line.split(' ')[-1]
            offs = len(mline) - len(text)
            completions = self.module_args(line.split()[0])
            return [s[offs:] + '=' for s in completions if s.startswith(mline)]
    def module_args(self, module_name):
        in_path = module_loader.find_plugin(module_name)
        oc, a, _, _ = plugin_docs.get_docstring(in_path, fragment_loader, is_module=True)
        return list(oc['options'].keys())
    def run(self):
        super(ConsoleCLI, self).run()
        sshpass = None
        becomepass = None
        
        self.pattern = context.CLIARGS['pattern']
        self.cwd = self.pattern
        
        self.remote_user = context.CLIARGS['remote_user']
        self.become = context.CLIARGS['become']
        self.become_user = context.CLIARGS['become_user']
        self.become_method = context.CLIARGS['become_method']