Completions may benefit from using these in tandem to dynamically generate
completions predicated on the value of an earlier token in a cleaner fashion.
(Currently, most of called completion helper functions introspect the command
line to get the value of an earlier argument, making them less reusable for
different expressions that need completions of the same type. This way, the
completion can provide the function with the argument value explicitly.)
As of FreeBSD 13 (released April 2021), FreeBSD has rebased its zfs support on
top of the OpenZFS distribution previously used only/chiefly by Linux;
accordingly, it has gained support for some previously Linux-only completions.
This patch changes some completions previously predicated on a Linux ZFS
installation to the presence of an OpenZFS installation. Note that there
continue to be (and probably always will be) separate Linux-only and
FreeBSD-only completions (and not just when it comes to interacting with the
device subsystem, etc).
Cursory experiments reveal that there are only three color options where
the background color is not ignored (though I didn't check all of them).
For these three options, the foreground color is ignored. Similar for
bold/italics/underline.
Teach set completions to only show the colors that won't be ignored.
Unrelated observation: we write
-a '--background=(set_color --print-colors)'
instead of
-l background -a '(set_color --print-colors)'
because we want all colors to show straight away (there are no other
meaningful arguments).
4b018a760 (set completions: add more special variables, fix colors, 2021-12-13)
changed a global variable to a local, which is no longer visible to this
function. Fix this, so "set LANG <TAB>" works again.
A history search ends when you move the cursor, but the commandline inserted by
history search is still marked as transient. This means that the next history
search will clear the transient commandline. This means we are dropping an undo
point, for example:
echo 11
echo 1
echo autosuggestion
echo^P # commandline is "echo 1"
^A # stop history search
^P # commandline is "echo 11"
^Z # Bug: commandline goes back to "echo", but it should be "echo 1"
In the worst case, we are switching from line-search to token-search (see
the attached test case). Clearing the transient edit means the line is gone
and only the token is left on the command line.
fish outputs the result of fish_title inside an escape sequence, which
happens to be terminated by \a (BEL). It may happen that the initial
output is interrupted; fish then emits the closing BEL and that makes an
annoying beep. Output the fish_title all at once, even if a signal is
delivered (so we don't get "stuck inside" the sequence).
This is related to #8628 in that it's a "torn escape sequence."
Say the user has a multi-char binding (typically an escape sequence), and a
signal arrives partway through the binding. The signal has an event handler
which enques some readline event, for example, `repaint`. Prior to this
change, the readline event would cause the multi-char binding to fail. This
would cause bits of the escape sequence to be printed to the screen.
Fix this by noticing when a sequence was "interrupted" by a non-char event,
and then rotating a sequence of such interruptions to the front of the
queue.
Fixes#8628
readch_timed is called after reading the escape character \x1b. The escape
char may be a standalone key press or part of an escape sequence; fish
waits for a little bit (per the fish_escape_delay_ms variable) to see if
something else arrives, before treating it as standalone escape-key press.
It may happen that a signal is delivered while fish waits. Prior to this
change we would treat this signal as a "nothing was read" event, causing
escape to be wrongly treated as standalone.
Avoid this by using pselect() with a full signal mask, to ensure this call
completes.
check_exit events are generated to give the reader a chance to respond to
commands, or otherwise to return control to the reader loop. Prior to this
change they were being passed to match key bindings. This is useless since
no key binding can match a check_exit event. FLOG noisily complains about
unmatched events. So just don't pass these to mapping_execute.
We detect one terminal (foot) with a "string match" command, and all others in a long "test"
command. Let's put the detection of each terminal on a new line. This should be easier to read
and change. It also allows to lose one level of indentation.
This takes the changes from 03b23dd1b6
and applies them to the .theme version as well.
(note: It's *possible* to just go through fish_config in future, but
we do not want to do that right now because that can have issues on
upgrade)
This was an undocumented undunderscored function that wouldn't be
super useful to actually use manually (because it still checked if the
variable was set!). It also relied on `__init_uvar`, which was only
set in `__fish_config_interactive`.
Additionally it didn't remove any complexity because this was all very
simple "do thing a, do thing b, do thing c" stuff. It added a layer of
indirection instead, and made fish startup dependent on another
function.
If you want to reset your colorscheme to the default, use fish_config.
Add completions that are correct on darwin and probably bsd.
Add missing -H, -L, -P completions to GNU chown.
Remove errant GNU completion claiming -h is short for --help.
The regex for task names was a bit off, so
- include uppercase letters, to support `TMessagesProj:assembleMiniRelease`
- don't include characters like `[]` (which happen to lie between ASCII `A` and `z`)
- include numbers, which are presumably valid in an identifier
- explicitly include the optional ` - ` bit in the regex
Yosemite know's about system-ui.
We do know `-apple-system` predated `system-ui` and are otherwise
aware that `Menlo` and `Helvetica Neue` will exist and be 'right'
on 10.10 and earlier.
- Use named colors instead of hex values - not sure how this
happened in the first place, these all map to basic named colors.
- Reinitialize if these were last set on fish <3.4, new variables
have been added.
- Break this into a separate function for the sake of
__fish_config_interactive complexity, and allow for running
manually.