Artificial intelligent assistant

Rebinding "clear prompt" in mutt By default, when entering information at the command prompt in `mutt`, you can clear the prompt with `Ctrl``g`, as described in the manual: ^G n/a abort I have been trying to bind this function to `Escape`. Unfortunately, `abort` is not listed in the available functions, either in the manual, or in the source. I have tried using this in my `.muttrc`: bind editor <esc> abort but it throws an error: > Error in /home/jason/.mutt/muttrc, line 143: abort: no such function in map I have tried using a different map, like (`generic`) and experimented with other fictitious functions, like `clear`, to no avail. How would I bind `Escape` to clear the prompt line?

# mutt

It's not possible with key bindings. `Ctrl-G` is hardcoded in mutt at a lower level than the macro or keybinding processing (see `mutt_getch()` in mutt's source code, at the core of all user input in mutt that returns an error upon `^G`).


macro editor \e '^G'


wouldn't work either.

What you can do is configure your terminal to send `^G` upon pressing `Escape`

With xterm:


xterm -xrm 'XTerm.VT100.translations: #override Escape: string(0x7)'


If you're using `screen`, you can also do


screen -X bindkey $'\e' stuff $'\a'


before calling mutt and restore it afterwards (unfortunately, it doesn't seem you can have per screen window key bindings in screen). Also, it's going to be a problem if your editor for email messages is vi.

# neomutt

Since release 20200313 There's `$abort_key` config variable to change the default `Ctrl-G`.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 4bf8411daea2ccdde31683bae33dc868