diff --git a/README.md b/README.md index da5c69547..12d22bb8d 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ Aider has some ability to help GPT figure out which files to edit all by itself, * Large changes are best performed as a sequence of thoughtful bite sized steps, where you plan out the approach and overall design. Walk GPT through changes like you might with a junior dev. Ask for a refactor to prepare, then ask for the actual change. Spend the time to ask for code quality/structure improvements. * Use Control-C to safely interrupt GPT if it isn't providing a useful response. The partial response remains in the conversation, so you can refer to it when you reply to GPT with more information or direction. * Use the `/run` command to run tests, linters, etc and show the output to GPT so it can fix any issues. -* Use Control+ENTER to enter a multiline chat message. Or enter `{` alone on the first line and end the multiline message with `}` alone on the last line. +* Use ESC-ENTER to enter a multiline chat message. Or enter `{` alone on the first line and end the multiline message with `}` alone on the last line. * If your code is throwing an error, share the error output with GPT using `/run` or by pasting it into the chat. Let GPT figure out and fix the bug. * GPT knows about a lot of standard tools and libraries, but may get some of the fine details wrong about APIs and function arguments. You can paste doc snippets into the chat to resolve these issues. * [Aider will notice if you launch it on a git repo with uncommitted changes and offer to commit them before proceeding](https://aider.chat/docs/faq.html#how-does-aider-use-git). diff --git a/aider/io.py b/aider/io.py index c27b0069f..086813b61 100644 --- a/aider/io.py +++ b/aider/io.py @@ -5,10 +5,9 @@ from pathlib import Path from prompt_toolkit.completion import Completer, Completion from prompt_toolkit.history import FileHistory +from prompt_toolkit.key_binding import KeyBindings from prompt_toolkit.lexers import PygmentsLexer from prompt_toolkit.shortcuts import CompleteStyle, PromptSession, prompt -from prompt_toolkit.keys import Keys -from prompt_toolkit.key_binding import KeyBindings from prompt_toolkit.styles import Style from pygments.lexers import MarkdownLexer, guess_lexer_for_filename from pygments.token import Token @@ -207,9 +206,9 @@ class InputOutput: kb = KeyBindings() - @kb.add(Keys.ControlM, eager=True) + @kb.add("escape", "c-m", eager=True) def _(event): - event.current_buffer.insert_text('\n') + event.current_buffer.insert_text("\n") session = PromptSession(key_bindings=kb, **session_kwargs) line = session.prompt()