This injected filenames into fish script, which could inject things
that looked like fish script.
E.g. create a file called `~/.config/fish/themes/"; rm -rf ~/*"`.
Note that the prompts are all shipped by us, but the themes can
technically be added by the user, and they might not be dilligent in
what filenames they allow.
`fish_config theme`:
- `list` to list all available themes (files in the two theme
directories - either the web_config/themes one or
~/.config/fish/themes!)
- `show` to show select (or all) themes right in the terminal - this
starts another fish that reads the theme file and prints the sample
text, manually colored
- `choose` to load a theme *now*, setting the variables globally
- `save` to load a theme and save the variables universally
- `dump` to write the current theme in .theme format (to stdout)
- `demo` to display the current theme
In the variable handler, we just go through the entire thing and keep
every element once.
If there's a duplicate, we set it again, which calls the handler
again.
This takes a bit of time, to be paid on each startup. On my system,
with 100 already deduplicated elements, that's about 4ms (compared to
~17ms for adding them to $PATH).
It's also semantically more complicated - now this variable
specifically is deduplicated? Do we just want "unique" variables that
can't have duplicates?
However: This entirely removes the pathological case of appending to
$fish_user_paths in config.fish (which should be an FAQ entry!), and the implementation is quite simple.
* Add initial completion for Angular CLI
* Remove completion for `ng completion`
The `ng completion` doesn't exist. The completiond were autogenerated
using a script. See angular/angular-cli#21085
* Use shorter wording
* Fix typos
These are simple
var val [val val]
files. Basically the bit in `set -g fish_color_escape 86c1b9` after
the `set -g `. Since we're not going to `source` them, however,
arbitrary code and expansions are unsupported.
Also comments and such don't currently work.
This allows them to be easily readable both from webconfig (next
commit) and the shell (later).
This used to pass each color in a separate url-encoded request, which is
just wasteful.
Also it passed separate parameters for modifiers like bold and
underlined, but never gave them actual values. Instead the color is
passed as one string.
So we just use json, and then iterate over it server-side.
This introduces two functions to
- toggle a process prefix, used for adding "sudo"
- add a job suffix, used for adding "&| less"
Not sure if they are very useful; we'll see.
Closes#7905
I almost always use this on the last/only job in a commandline, so
the semicolon is usually not needed. We have always added it but I
prefer not dropping it: this feels cleaner because it's what you'd
type without the shortcut.
Similarly to b0e3cc4b5 (__fish_complete_suffix: Remove `eval`,
2019-12-28), this use of eval is unsafe and can spew errors if
invoked on an incomplete brace expansion.
Commit d15a51897 ("Rationalize $LESS uses") switched a "less" flag
from -r (interpret all control characters)
to -R (interpret only color codes)
Somehow this changed the output of "fish -c 'command -h'" to include
weird characters:
DESCRIPTION^O
command^O forces the shell to execute the program COMMANDNAME^O and ignore any functions or builtins with the same name.
Probably this was the reason why I originally used -r over -R. Anyway,
-R is safer and it looks like we can just remove the "ul" preprocessing
since "less" will interpret bold/underline just fine.