Repository navigation
feat: rudimentary readline macro support - #880
Merged
Merged
Conversation
Test Results 3 files 26 suites 9m 35s ⏱️ Results for commit e7f6fc3. ♻️ This comment has been updated with latest results. |
Public API changes for crate: brush-coreRemoved itemsAdded itemsPublic API changes for crate: brush-parserRemoved itemsAdded itemsPerformance Benchmark Report
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is Test Summary: bash-completion test suite
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements rudimentary readline macro support, specifically targeting compatibility with atuin's integration script. The implementation is intentionally minimal, supporting only byte-based macros (uninterpretable key sequences) rather than full stroke-based macro functionality.
Key changes:
- Renamed
ReadlineTarget::CommandtoReadlineTarget::Macroto better reflect its purpose - Converted
KeySequencefrom a struct with a publicstrokesfield to an enum withStrokesandBytesvariants to support both interpretable and raw key sequences - Added new methods to the
KeyBindingstrait:get_untranslated,try_unbind, anddefine_macroto support macro functionality
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| brush-parser/src/readline_binding.rs | Renames ReadlineTarget::Command to Macro, adds public parse_key_sequence function, and updates key sequence parsing to handle escape bytes as stroke boundaries |
| brush-core/src/interfaces/keybindings.rs | Converts KeySequence from struct to enum (breaking change), adds Clone derives to support macro storage, extends KeyBindings trait with macro-related methods |
| brush-interactive/src/reedline/edit_mode.rs | Implements macro storage and resolution logic, adds raw byte sequence mappings, and provides limited macro binding support (currently only supports byte-based macros with single actions) |
| brush-builtins/src/bind.rs | Updates bind builtin to parse and handle macro bindings, changes key sequence parsing to return enum variants, and routes macro definitions to the new define_macro trait method |
reubeno
marked this pull request as ready for review
December 30, 2025 20:51
reubeno
force-pushed
the
rudimentary-macros
branch
from
December 30, 2025 20:51
af4127a to
cdfc8ef
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Very minimal -- just enough for atuin's integration script. Not (yet) enough for
fzf's....