feat(repl): bring REPL to feature parity with ZSH shell plugin#2984
Open
tusharmath wants to merge 10 commits intomainfrom
Open
feat(repl): bring REPL to feature parity with ZSH shell plugin#2984tusharmath wants to merge 10 commits intomainfrom
tusharmath wants to merge 10 commits intomainfrom
Conversation
…ver marketing language
…ker and add preview support
d61c37c to
ef20df4
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.
Summary
Bring the REPL to feature parity with the ZSH shell plugin by adding fzf-based file and command pickers, a syntax highlighter, a starship-style prompt redesign, and a unified
forge list filecommand that both the REPL and the shell plugin now share.Context
The ZSH shell plugin has long had rich completion (fzf +
fd, bat preview, colon-prefix commands, highlighted input) that the built-in REPL lacked. Users switching between shell mode and REPL mode experienced a jarring inconsistency. This PR closes that gap by porting the ZSH experience into the REPL itself, while also sharing the underlying file-listing logic through a newforge list fileCLI command so the shell plugin no longer needs a separatefddependency.Changes
ForgeWidget(fzf). File completions now open an interactive picker with bat-powered syntax-highlighted previews (falls back tocat), matching the shell plugin's@-mention completion experience./and:commands with an fzf popup that shows each command name and description side-by-side, making command discovery much easier.:commandnow works identically to/commandin both completion and execution, matching shell plugin behaviour.highlighter.rsthat colours slash/colon commands, shell (!cmd) commands, and file mentions ([path]) in real-time as the user types, giving immediate visual feedback.1.5k), cost, and dims all labels when the session is inactive (no tokens consumed yet).forge list fileCLI command — newforge list --file/forge list filessubcommand that walks the workspace with the same rules asfd --type f --type d --hidden --exclude .gitand prints one path per line. The shell plugin'scompletion.zshnow delegates to this command instead of callingfddirectly, removing the external dependency.Walker::get_blockingmigrated toWalkBuilder::build_parallel()for better performance on large workspaces. Newhiddenflag controls dotfile visibility (false= include hidden, matchingfd --hidden)..gitdirectory is always excluded.Key Implementation Details
Walker::max_all()(used by the REPL picker andforge list file) setshidden: false, so dotfiles are included just likefd --hidden --exclude .git.Walker::default()keepshidden: truefor agents that should not see dotfiles. The parallel walker usesArc<Mutex<…>>shared state so all threads contribute to the same collection and global limits. The fzf command picker buildsCommandRowdisplay objects (namepadded to 30 chars + description) and pre-populates the fzf query with whatever the user has already typed after the sentinel.Use Cases
Testing
Links