This is a long-standing issue with how `complete --do-complete` does
its argument parsing: It takes an optional argument, so it has to be
attached to the token like `complete --do-complete=foo` or (worse)
`complete -Cfoo`.
But since `complete` doesn't take any bare arguments otherwise (it
would error with "too many arguments" if you did `complete -C foo`) we
can just take one free argument as the argument to `--do-complete`.
It's more of a command than an option anyway, since it entirely
changes what the `complete` call _does_.
This command can be used to "`cat`" the contents of `$path` as of `$rev`.
These are "silent" completions, e.g. while this adds a completion for
`git show master:foo`, the completions for `git show <TAB>` are not
affected; these "advanced" completions kick in only after at least
`git show master:<TAB>` to prevent completion pollution or slowing down
tab completions in the typical case (as this would cause each valid and
possibly unique $rev completion result to complete to `n*$rev`
completions for *n* files.
[ci skip]
Dealing with macOS output in a fast manner using `string` is surprisingly hard, given that it features lines like
gls(1), ls(1) - list directory contents
Printing the "gls" with the description and the "ls" with the description requires a `while read` loop, and that's too slow.
This reverts commit 7784a5f23c.
[ci skip]
* Some comment fixes and renaming of is_iterm2_escape_seq.
The comment for is_iterm2_escape_seq incorrectly says "CSI followed by ]".
This is wrong, because CSI is ESC followed by [ (or the seldom-used 0x9b).
The procedure actually matches Operating System Command (OSC) escape codes.
Since there is nothing iterm2-specific about OSC, is_osc_escape_seq
would be a better name.
Also s_desired_append_char documents a non-existent parameter.
* Update broken iterm2 url in comment.
This was added in 04a96f6 but not strictly required to fix#5803
(verified), with the intention of hiding invisible background jobs
(created by invoking a function within a pipeline) from the user, but
that also broke intentionally created jobs from displaying as well.
I'm thinking it can't be done without keeping track of caller context vs
job context.
Closes#5824.
env_scoped_t lives between environment_t and env_stack_t.
It represents the read-only logic of env_stack_t and will be used to back
the new environment snapshot implementation.
These tests used raw, unescaped parentheses to perform `test` logical
grouping, but the test failures weren't caught because the parser
evaluation errors were not being propagated (fixed in bdbd173e).