aider icon indicating copy to clipboard operation
aider copied to clipboard

Feature Proposal: Command History Search Enhancement with Up Arrow - Match History from Prefix

Open GeoffMillerAZ opened this issue 1 year ago • 1 comments

Issue

Problem:

Currently, when using aider, pressing the up arrow cycles through all previous inputs, including full chat messages and commands. This can be inefficient, especially when trying to quickly re-run a command from history. Often, chat inputs are long, and sorting through them to find a specific command can be time-consuming.

Proposed Solution:

Implement a feature that allows users to filter command history based on what they've already typed. For example:

  • If the user types a command prefix, such as ! (shorthand for /run), and then presses the up arrow, it should only cycle through recent commands that match the prefix (e.g., /run commands), rather than cycling through all previous inputs.

This would allow users to easily re-run commands without having to manually scroll through lengthy chat histories.

Example Use Case:

  1. Typing a Command:
    • User types ! to indicate they want to run a command (e.g., !test).
  2. Press Up Arrow:
    • Pressing the up arrow will now filter the history to show only past commands that start with /run, or more specifically /run test if they've typed !test.
  3. Efficient Access to History:
    • This saves time by allowing users to quickly find and re-run relevant commands without scrolling through unrelated chat inputs.

Why This is Useful:

  • Efficiency: Users can quickly re-run commands they've executed before without having to scroll through lengthy chat history.
  • Precision: Filtering based on what has been typed ensures that users only cycle through relevant commands, improving the speed of the workflow.
  • Familiarity: This feature mimics behavior found in many shell environments, providing a more intuitive experience for users who are accustomed to this functionality.

This feature would enhance the overall experience by making the command history more accessible and usable, particularly in sessions with long or numerous chats.

Version and model info

No response

GeoffMillerAZ avatar Sep 15 '24 23:09 GeoffMillerAZ

Thank you for filing this issue.

You can search backwards through the command history with Ctrl-R, see also -> https://aider.chat/docs/usage/commands.html#keybindings

fry69 avatar Sep 16 '24 04:09 fry69

I'm going to close this issue for now, but feel free to add a comment here and I will re-open. Or feel free to file a new issue any time.

paul-gauthier avatar Sep 20 '24 19:09 paul-gauthier