Add special-case readline completion logic for first-position#202
Closed
jpco wants to merge 3 commits intowryun:masterfrom
Closed
Add special-case readline completion logic for first-position#202jpco wants to merge 3 commits intowryun:masterfrom
jpco wants to merge 3 commits intowryun:masterfrom
Conversation
Now we know we're in command position after `blah <=` and `blah |[2] `.
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.
We can't complete
%pathsearched binaries, but we can complete some things in "first position". So this adds:;or&or|or{).localletforfn%closurematchShortcomings:
()properly; I believe doing that would require a novel (within es) method of retaining previous-line state.~/or~username/don't have filtering for whether they're executable, because I didn't want to bother with tilde expansion.Possible further improvements for builtin completion:
path =)$&, but it should actually happen at start-of-command positionOf course, programmable completion based on semi-parsed input and something like #178 would be the "real", long-term goal, but this is a useful stop-gap and helps inform how its design would need to work.
A funny outcome of this change:
path-cache.esmakes it so that running a binary once makes that binary name complete-able from then on.This code is getting messy... Also, my attitude for readline integration (somewhat unlike my attitude for the rest of the shell) is that these kinds of "80%-working" solutions are okay. If other people want to vocally disagree with that, please do :)