Add special-case readline completion logic for first-position #202
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
%pathsearch
ed binaries, but we can complete some things in "first position". So this adds:;
or&
or|
or{
).local
let
for
fn
%closure
match
Shortcomings:
()
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.es
makes 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 :)