Commit Graph

4096 Commits

Author SHA1 Message Date
Wolfgang Müller
4a3df618f2 __fish_list_current_token: Do not use eval
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.
2021-06-22 17:44:32 +02:00
Johannes Altmanninger
6c88c7d200 __fish_print_help: remove spurious bold/underline control characters
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.
2021-06-20 20:58:15 +02:00
Johannes Altmanninger
73b13315de completions/dd: re-use built-in file completion for "dd if=the-file"
This allows to complete file arguments even if they contain variables.

Add similar logic for arguments to Maven's -D option.

See https://github.com/fish-shell/fish-shell/issues/5248#issuecomment-857614957
2021-06-19 20:31:46 +02:00
Johannes Altmanninger
48426d6285 Tweak git completion wording (review for #8062) 2021-06-19 10:10:59 +02:00
lelgenio
b8767cc803 completions/sv.fish: create completion for sv, a part of runit. 2021-06-19 08:17:53 +02:00
Collin Styles
a5e665cd81 Add completions for "empty" options to git-commit 2021-06-18 20:49:34 +02:00
Collin Styles
feec10f389 Add completions for different types of git resets 2021-06-18 20:49:34 +02:00
Collin Styles
0abbd2bc2f Add completions for git-revert sequencer subcommands 2021-06-18 20:49:34 +02:00
Collin Styles
15fdfb5afe Add completion for --abbrev-ref option to git-rev-parse 2021-06-18 20:49:34 +02:00
Collin Styles
c9f397b968 Remove invalid completion for git-describe
The `__fish_git_unique_remote_branches` function isn't applicable here
since `git describe` won't know what to do with a remote branch without
the remote prefix. For example, if there is a branch called
`origin/my-branch`, you can't execute `git describe my-branch` until the
branch is checked out locally. In other words:

Good: `git describe origin/my-branch`
Bad:  `git describe my-branch`
Good: `git switch my-branch; git describe my-branch`
2021-06-18 20:49:34 +02:00
Collin Styles
7d5c64a731 Fix completions to cargo's --example option on macOS
The completions for the `--example` option are generated using `find`.
The `find` utility on macOS will produce the following output when the
path argument has a trailing slash:

```
~/bat $ find ./examples/
./examples/
./examples//cat.rs
./examples//advanced.rs
./examples//simple.rs
./examples//list_syntaxes_and_themes.rs
./examples//yaml.rs
```

And will produce this output if the path does NOT have a trailing slash:

```
~/bat $ find ./examples
./examples
./examples/cat.rs
./examples/advanced.rs
./examples/simple.rs
./examples/list_syntaxes_and_themes.rs
./examples/yaml.rs
```

The extra slash after `examples` ends up in the completion suggestions
which is incorrect:

```
~/bat $ cargo run --example <TAB>
/advanced  /cat  /list_syntaxes_and_themes  /simple  /yaml
```

Unlike on my Linux box where `find` doesn't output the trailing slash:

```
~/bat $ cargo run --example <TAB>
advanced  cat  inputs  list_syntaxes_and_themes  simple  yaml
```

Importantly, I get the same (correct) output on Linux even without the
trailing slash in the path argument to `find`.
2021-06-15 21:22:44 +08:00
Johannes Altmanninger
701b7450df __fish_is_first_arg: only look at current process
This fixes the completions in

	btrfs command | btrfs <TAB>

See #8060
2021-06-15 03:38:52 +02:00
Johannes Altmanninger
f0de75ddd9 completions/git: complete normal files on "git restore -sHEAD "
A full "git ls-files" is slow on larger repositories; this makes the
common case (desired path exists on file system) faster.
2021-06-15 03:27:55 +02:00
Johannes Altmanninger
585dc16a66 completions/git: complete normal files on "git checkout -- "
This can give false positives but only if used on directories that
mix tracked and untracked files. The performance is better than
listing all tracked files, and in any case we're pretty far from a
correct solution that knows the target Git commit, so this seems like
good compromise.
2021-06-15 03:27:55 +02:00
Fabian Homborg
9e46d49dd9 webconfig: Remove tab top border in dark mode 2021-06-10 21:26:03 +02:00
Fabian Homborg
e571902a85 webconfig: Hover more things
The buttons were already supposed to highlight on hover, but the color
difference was barely visible. Crank that up.

Also add a hover color to the tabs, colorschemes, prompts, functions.

The big clickable things.
2021-06-10 21:25:40 +02:00
Fabian Homborg
f6a6537f7b css: Some minor adjustments
Make borders less bright in dark version, add some padding to the body.
2021-06-10 21:00:18 +02:00
Fabian Homborg
695027234b completions/git: Complete untracked files immediately
Fixes #8049
2021-06-08 08:53:49 +02:00
Fabian Homborg
e57c998d4c webconfig: Make a bit nicer on smaller screens
Actually remove the margins, distribute the color choices evenly and
switch to small mode a bit earlier.
2021-06-05 11:46:23 +02:00
Fabian Homborg
7a5e192607 Make background a bit more blue, brighter 2021-06-05 11:17:53 +02:00
Fabian Homborg
c2b35d3171 Adjust colors a teensy bit
Make a bit less ultra-dark blue
2021-06-05 11:17:53 +02:00
Fabian Homborg
64bbc8b304 webconfig: Dark mode 2021-06-05 11:17:53 +02:00
Fabian Homborg
155160e49b Msys also has a weird kill
Like Cygwin, it doesn't feature an option to list the signals, so we
simply hardcode them.

Fixes #8046.
2021-06-05 11:15:53 +02:00
Fabian Homborg
5f4dfd9951 webconfig: Remove weird position: absolute
This made the current prompt appear directly under the tab,
disregarding the padding.

That means it looked inconsistent with the colors. (note there's still
less padding on the side, but at least that allows more actual content
- prompts are often fairly wide)
2021-06-03 20:55:36 +02:00
Fabian Homborg
4e718506e3 Vi-bindings: Use fish_clipboard_copy
This has one slight behavioral change: Even with xsel, it now copies
to the clipboard, not the primary. I would imagine anyone who cares
about the primary selection has customized fish_clipboard_copy and
because we never got a bug about this not supporting anything but
xsel (and errorring out if it's not available!) this is probably
unused.

So now we support all the clipboard integration things, and we use the clipboard.
2021-06-03 10:04:30 +02:00
mtoohey31
6ca9f9ee38 fish_vi_key_bindings: bind s to follow vim visual behaviour
This change adds a binding that sets the s key's behaviour to match
the c key's in visual mode. This mirrors vim's behaviour (see `:h v_s`
in vim or neovim).
2021-06-03 09:57:22 +02:00
Fabian Homborg
a633889244 ls: Ignore ruby colorls
Apart from OpenBSD's "colorls" that is basically an ls that can do
color, there's also a ruby tool called "colorls" that's closer to exa.

Ignore that one since the options it understands are quite different
and I'm betting it's slower (given my experience with ruby tools).

See #8042.
2021-06-03 09:54:20 +02:00
Fabian Homborg
344bd63e0b webconfig: Remove unneeded inline style
This makes changing it harder and is unnecessary
2021-06-02 17:57:48 +02:00
Scott Bonds
ad38730792 ignore __fish_ls_color_opt when using colorls 2021-06-01 20:10:04 +02:00
Scott Bonds
3ddb5a2bdc
Add color to ls output on OpenBSD when colorls is installed (#8035)
* add support for colorized ls on openbsd

* add changelog line for colorls support

* add readme line for colorls support

* determine ls command at runtime, don't cache it

* eliminate __fish_ls_command function
2021-06-01 19:46:13 +02:00
gurudarshan266
b5d48acd7c
Condensed descriptions for various commands (#8034)
* Shorten descriptions for tmux.fish

* Shorten descriptions for bundle.fish

* Fix description in dhclient.fish
2021-05-28 18:50:01 +02:00
exploide
34ededa644 updated hashcat completions to version 6.2.1 2021-05-26 13:04:36 +02:00
Jyry Hjelt
08a455d4f1 Fixed a typo in rc-update autocompletion 2021-05-18 13:55:27 +02:00
Johannes Altmanninger
e10cab8104 Tweak documentation wording to include non-option arguments 2021-05-16 20:48:53 +02:00
Kid
e714ce238e Add missing options for complete 2021-05-16 17:33:49 +08:00
Fabian Homborg
d15a51897d Rationalize $LESS uses
Stop using "--no-init"/"-X" because we have no actual reason to and it
may break mouse initialization on my best friend macOS.

Use --RAW-CONTROL-CHARS, the capital version that only lets through
specific escape sequences, not *everything* - we shouldn't have
anything weird here, but less heavily discourages the other version.

Allow a user's $LESS to override.

Fixes #7997.
2021-05-14 22:18:59 +02:00
Fabian Homborg
2cfb4343ed man: Remove useless dirname call
This removed "/fish" just to add it back.
2021-05-14 21:49:53 +02:00
Érico Nogueira
3ac2242c68 completions: fix pacmd completions when using pipewire-pulse.
In such cases, `pacmd help` prints

  No PulseAudio daemon running, or not running as session daemon.

to stderr, which ends up printed to the user terminal.
2021-05-14 21:19:06 +02:00
Fabian Homborg
dbc6bffe3c __fish_set_locale: Ignore $LANGUAGE
This isn't really a "locale" variable as such. It has no effect on
encoding and stuff, it's just the output language.

What we really want here is get something better than the awkward "C"
or "POSIX" for LC_CTYPE specifically - everything else doesn't really
matter.
2021-05-11 21:53:58 +02:00
ridiculousfish
3f35012afb Fix openssl completions for LibreSSL
Fixes #7966
2021-05-05 14:42:36 -07:00
ridiculousfish
f25b9f9831 Make the webconfig HTTP server threaded, fixing a Safari hang
Recently Safari seems to hang with fish webconfig. This is apparently
because Safari is opening a socket and not writing to it, causing
webconfig to hang until the timeout (30 seconds). It's not clear why.

Use ThreadingMixIn so that FishConfigTCPServer can handle more
than one connection at a time. This fixes the hang under Safari.
2021-05-05 13:29:55 -07:00
Johannes Altmanninger
fa74dc977b fish_greeting: show private mode message if $fish_greeting is empty list
This was droped because of Cartesian product expansion.
Also fix the spurious dot in case the greeting is "".

Fixes #7974
2021-05-05 18:53:51 +02:00
Cycatz
889ff25c75 Remove extra chars after -p and --load options 2021-05-05 21:45:16 +08:00
ridiculousfish
b823b91bcd Remove an errant newline from the dirs function
The dirs function prints an extra newline; it is not obvious why this is
needed but it has been this way forever. Let's remove it.
2021-05-04 13:32:21 -07:00
Fabian Homborg
c55aa48308 Default colorscheme: Change pager prefix color for light terminals
From my checks (gnome-terminal with the "gnome light" colorscheme)
this seems to be the only color that's barely visible in a light
terminal, and it's the only color mentioned in both bug reports.

I'm leaving the artistic decisions to others, this is now *acceptable*
in both.

Note that, because we use universal variables here (hint #7317), this
will only be changed for preexisting installations when the user
reloads the colorscheme.

Fixes #3412
Fixes #3893
2021-05-01 20:16:23 +02:00
Fabian Homborg
1908cf95de Double default cnf-handler
This was defined in config.fish.

Just define it here again, it's trivial.
2021-05-01 18:59:25 +02:00
Fabian Homborg
0420901cb2 default prompt: Set fish_color_status if unset
Otherwise this'll error with --no-config
2021-05-01 18:59:25 +02:00
Fabian Homborg
2b74affaf0 Add prompt selector
It's a bit weird to *have* to fire up a browser to get fish_config to
choose a prompt.

So this adds a `prompt` subcommand to `fish_config`:

- `fish_config prompt list` shows all the available prompt names
- `fish_config prompt show` demos the available sample prompts
- `fish_config prompt choose` sources a prompt
- `fish_config prompt save` makes the choice permanent

A bare `fish_config` or `fish_config browse` opens the web UI.

Part of #3625.

TODO: This shows the right prompt on a new line. Showing it in-line is awkward
to do because we'd have to move it to the right.
2021-05-01 18:50:05 +02:00
Fabian Homborg
e548dca686 Webconfig: Fix initial tab
For some reason the url is now

http://localhost:$PORT/$RANDOM/#!/$TAB

while this created

http://localhost:$PORT/$RANDOM/#$TAB

which redirected to

http://localhost:$PORT/$RANDOM/#!/colors#$TAB

i.e. the "colors" tab with a useless unmatched anchor.
2021-05-01 18:47:49 +02:00
Johannes Altmanninger
daa3ae4be1 fish_config: use background color for some themes search matches
See https://github.com/fish-shell/fish-shell/issues/2442#issuecomment-829636721
2021-04-30 22:13:23 +02:00
Fabian Homborg
2e9dab71a3 __fish_apropos: Don't overwrite $dir 2021-04-30 20:09:56 +02:00
Fabian Homborg
c25efeed7a __fish_apropos: Fix broken variable name 2021-04-30 20:07:20 +02:00
Fabian Homborg
f485169391 __fish_apropos: Fix on macOS
Because MacOS' apropos is bad and doesn't support the `--` option
separator, this apparently spews errors.

Because the argument _can't_ start with a `-` (because we add a `^`),
we can just remove it.

Fixes #7965.
2021-04-30 19:16:57 +02:00
Fabian Homborg
2cea5b8eb1 Add a "prompt_login" helper function
This prints a description of the "host". Currently that's

`(chroot:debianchroot) $USER@$hostname`

with the chroot part when needed.

This also switches the default and terlar prompts to use it, the other
prompts have slightly different coloring or logic here.
2021-04-30 17:07:54 +02:00
tomKPZ
7735d13d79 Fix prompt reflow in kitty terminal 2021-04-28 08:14:08 +02:00
Fabian Homborg
8cd5f6cfde funcsave: Don't save details
The "# defined in /path/to/file" comment here is, almost by
definition, wrong.
2021-04-27 16:33:41 +02:00
Fabian Homborg
6aade380c1 Sample prompts: Handle print_pipestatus if TERM=dumb
This is the simple solution of just quoting it. The real solution
would probably handle `set_color` with no color better - #5443.

Fixes #7904.
2021-04-25 09:49:18 +02:00
Fabian Homborg
f21e015f1b webconfig: Make blue, green, red a bit brighter
These were hard to read in the browser, but not in the terminal.

The palette in color.cpp lists #000080 for blue, which is *even darker*. I'm not sure if that's actually a thing - I was under the impression that table was taken from xterm.

Either way, listing it in this color doesn't do anyone any favors. It's just a rough approximation anyway.
2021-04-21 17:26:52 +02:00
Fabian Homborg
152b0ef018 Webconfig: Sort the prompt list
Otherwise this has filesystem order, which on my system is quite
chaotic.

An alternative would be to randomize the order so people see different
prompts each time.
2021-04-21 17:13:03 +02:00
Fabian Homborg
f2364103b4 Sample prompts: Add a simplified version of my own prompt
Some features:

- A nice `►` prompt char with a fallback for non-utf8 systems
- The $PWD is colored depending on its sha, so different directories
  are colored differently, but each directory stays the same
- User@Host is only shown if not on the local machine (ssh or
  virtualization)
- A right prompt with a nice git display, date, duration of the last
  command (if it took over 100ms), and virtualenv
2021-04-21 17:01:05 +02:00
Fabian Homborg
4355636386 webconfig: Handle right prompt
This gets fish to print the right prompt of any sample if it has any,
and then shows it separately.

If there is a right prompt, it will also save it. If not, it will *not* overwrite an existing right prompt.
2021-04-21 17:01:05 +02:00
Fabian Homborg
9c413b039d Also fix tokenizer_state in bracketed paste path
Also removes our remaining use of
`__fish_commandline_is_singlequoted`.

See #7782.
2021-04-20 15:29:28 +02:00
Fabian Homborg
dc57ba01a2 __fish_pwd: Just always define the cygwin version
This called `uname` just to check if we *should* shorten "cygdrive"
directories.

That's more annoying than just doing it by default - on my system `pwd
| string replace` takes about 100 *micro*seconds, and this is done
once per prompt. Anyway, using $PWD further speeds it up to ~30
microseconds (compared to 10-20 for just `pwd`). This is hard to
measure because it's heavily impacted by system hitter.

The alternative is to ask cygwin to ship this feature as a patch.
2021-04-19 18:58:00 +02:00
Johannes Altmanninger
6b41227ff4 completions/dnf: minor addition to always show RPM files
See #7928
2021-04-18 13:09:36 +02:00
Johannes Altmanninger
db0fe92aaa completions/dnf: cautiously complete RPM files
Complete RPM files instead of pacakges if there is either
1. a slash in the token, which precludes package names
2. no matching package

To enable 2, pass the commandline token to the dnf query, instead of
an undefined variable. This allows SQL injection; not sure if we care.

We could always complete RPM files but maybe that's too noisy.
Also, isn't that what the "rpm" command is for?

Closes #7928
2021-04-17 22:53:34 +02:00
Collin Styles
42c11f1b6c Remove completion files for ls aliases; just use function --wraps 2021-04-16 17:40:55 +02:00
239
5e66722452 Update completions for resolvectl 2021-04-15 17:38:26 +02:00
239
4688a84398 Update completions for loginctl 2021-04-15 17:38:26 +02:00
239
9b85254717 Update completions for Keybase 2021-04-15 17:38:26 +02:00
239
975cd13108 Update completions for cryptsetup 2021-04-15 17:38:26 +02:00
Fabian Homborg
84087f09d4 webconfig: Remove gigantic padding 2021-04-14 20:49:24 +02:00
Fabian Homborg
7eddf48cfa webconfig: Cleanup running prompts 2021-04-14 19:08:33 +02:00
Fabian Homborg
56af5d0702 Revert "git prompt: Show stagedstate without dirtystate"
After further thinking, showing this now, by default, without a nice way to turn it off isn't great.

This reverts commit 573fed7798.
2021-04-13 19:10:04 +02:00
Xirui Zhao
8bbb06bf5c vi mode: bind u/C-r to undo/redo in place of history search (#7908) 2021-04-13 18:47:34 +02:00
Fabian Homborg
4fa17bd512 git prompt: Don't compute bits we don't need 2021-04-13 16:44:46 +02:00
Fabian Homborg
573fed7798 git prompt: Show stagedstate without dirtystate
I have *no idea* why this was coupled, especially since dirtystate can
be expensive, staged state should not be.
2021-04-13 16:44:46 +02:00
Fabian Homborg
71166274a2 git prompt: Respect status_order even without informative status
Fixes #7926.

Also switches the default status order for non-informative to the informative one:

stagedstate invalidstate dirtystate untrackedfiles stashstate

instead of

dirty staged stash untracked
2021-04-13 16:44:46 +02:00
Fabian Homborg
a65933551d git prompt: Allow setting __fish_git_prompt_status_order
See #7926
2021-04-13 16:44:46 +02:00
Fabian Homborg
db7278bac6 git prompt: Remove that massive documentation block 2021-04-13 16:44:46 +02:00
Jason
80b2eb94f1 alias: print error msgs to stderr 2021-04-13 15:50:00 +02:00
Fabian Homborg
053acf5c6b bind ctrl-space only as a *preset* binding
Fixes #7922
2021-04-11 20:39:54 +02:00
Fabian Homborg
16d4424f6c webconfig: Only include path in error if we have one
This makes for a super misleading error message.

See #7917.
2021-04-10 11:53:36 +02:00
Fabian Homborg
4239ba133d Sample prompts: Add a "simple" prompt
This should be a simple prompt that doesn't place a huge strain on the
system but communicates the most important information simply and
effectively.

It should be a good jumping off point for making your own prompt.
2021-04-08 11:14:16 +02:00
Fabian Homborg
d4ce5507af Sample prompts: Rename classic+vcs to default
That's what it is, and without the "classic" prompt to compare it
doesn't make any sense anymore.
2021-04-08 11:14:16 +02:00
Fabian Homborg
34d4afac99 Sample prompts: Remove stray space after pipestatus
This would, with the default color, have an ugly red background.

So just remove the space.
2021-04-08 11:14:16 +02:00
Fabian Homborg
db9ac527af Sample prompts: Rename prompts named after a single person
Unless that person directly contributed the prompt.

We name them after a feature - the Scales prompt feature a ">>>" which
kinda looks like fish scales, the "Arrow" prompt starts with a
prominent "➜".

Naming them after people looks like an endorsement of that particular
person, and like they are someone to look up to, especially when they
aren't involved with the project.

The "terlar" and "acidhub" prompts stay for now because they
contributed the prompt themselves, they are also much less prominent.
2021-04-08 11:14:16 +02:00
Fabian Homborg
635a2c13f1 Sample prompts: Use fish_is_root_user
So we don't just check for "root"
2021-04-08 11:14:16 +02:00
Fabian Homborg
2bc2a92c9a Sample prompts: Stop using "git status" just to see if it is dirty
`git status` will descend the entire repo, which is *slooooow*
2021-04-08 11:14:16 +02:00
Fabian Homborg
31f86ed2cf Sample prompts: Use fish_git_prompt format string 2021-04-08 11:14:16 +02:00
Fabian Homborg
0a395b9568 Sample prompts: Remove default settings from informative vcs prompt
Some of these are just the git prompt defaults anyway, so remove them here.
2021-04-08 11:14:16 +02:00
Fabian Homborg
0586715696 Sample prompts: Remove duplicated or less useful prompts
The "classic" prompts are all just variations on a theme, let's just
keep the default classic+vcs.

"Justadollar" is very unlikely to be what you want and also trivial to
write yourself.

I have no idea what screen_savvy even is for - it reacts to "$WINDOW",
but I don't know anything that even uses that variable.

Lonetwin is just unremarkable, and the debian chroot prompt has one special feature that should be integrated into the other prompts.
2021-04-08 11:14:16 +02:00
exploide
89eeafe393 added completions for firewall-cmd (firewalld)
based on --help and man page of firewall-cmd 0.9.x
2021-04-05 18:59:58 -07:00
Phil Corbett
13439b399e Shortens RPM completions 2021-04-02 12:37:59 -07:00
Fabian Homborg
19004642ba __fish_apropos: Define again on non-macOS
This had a weirdly broken if condition.
2021-04-02 16:58:34 +02:00
Aaron Gyes
b9b2010342 rebuild whatis database weekly, not daily
I still don't think we even address rebuilding
manpage completions yet. Maybe they could share a
solution.
2021-04-02 02:12:00 -07:00
Aaron Gyes
0e03e49eb9 __fish_apropos: prepend $argv with ^
Because macOS' `apropos` is just using grep, and we only need
a prefix match for __fish_describe_command, we can shave off
some ok total execution time here.
2021-04-02 01:58:38 -07:00
Aaron Gyes
85e3381480 __fish_apropos: refactor, limit to 10.15+, change default cache dir.
No longer uses the __fish_apropos hack on every version of macOS.
Juat Catalina+.

The whatis database generated and replaced daily is 2 megabytes on
my computer, and in ~/.cache on a home dir might wind up on a net
mount or something annoying. or, definitely it's backed up by default.

It's wiser to throw that junk in with other cache files on the system
aka DARWIN_USER_CACHE_DIR, and only use the XDG directory if
someone specifically configured that.

Mainly, this just means at least it won't automatically get backed
up by Time Machine and stuff every day, which is no big deal but
y'know...

Rearranged stuff a little to not shell out every time.
2021-04-02 01:58:38 -07:00
Fabian Homborg
419675b9e5 mode_prompt: Use foreground instead of background colors
The default vi mode prompt is kind of ugly, mostly because we include
this `[I]` with a super bright green background and white text,
which is particularly grating because most prompts don't actually have
a background.

So we get a ton of people asking "How do I remove this [I]" when they
could really benefit from having the mode shown.

There's a few ways to make this look nicer, the simplest is to just
keep the same colors but use them as foreground instead of background
colors, which looks much more understated.

The mode prompt is important, but not more than the actual contents of
the commandline, so it shouldn't have ALARMING colors.
2021-03-31 18:04:53 +02:00
Fabian Homborg
f75cf5c16b git prompt: Use status --porcelain for informative status
This allows us to stop descending into untracked directories, which
can be faster.

It's still not *good* - git can still be quite slow here, but if
there's an untracked directory you probably don't care about the
number of files in that.

Fixes #7871.
2021-03-30 17:51:34 +02:00
Fabian Homborg
93ce805f32 help: Update completions
This is all of the sections in interactive, language and for_bash_users.

The faq names are so long that we're not adding them, also not all of
these have descriptions yet.
2021-03-30 17:40:38 +02:00
Fabian Homborg
d5cba5fe12 Teach help to pick the correct page
Given that we no longer have that massive "index" page with
everything, it's become harder to open the correct section
immediately.

So this hardcodes the section titles for each page in help itself.

This was half-automated with

grep -o 'a class="headerlink" href="#[^"]*"' /usr/share/doc/fish/faq.html | sort -u | string replace -r '.*#' '' | string trim -c '"'

The completions still need to be adjusted.
2021-03-30 17:14:14 +02:00
Fabian Homborg
18e332772d functions: Add "--no-details" flag and use it in funced
This inhibits the function path comment which is annoying in `funced`.

Fixes #7879.
2021-03-30 16:54:26 +02:00
lapingenieur
a68791fa89 [vi-mode] corrected normal/default mode pasting
In vim p means paste *after* current character, so go forward a char before pasting.
Also in vim, P means paste *at* current position (like at '|' with cursor = line),
so there's no need to go back a char, just paste it without moving.
2021-03-28 13:28:40 -07:00
Fabian Homborg
1705bd1440 __fish_man_page: Try man before
This is really just `less` being precious and `man` being unspecified.

Fixes #7863.
2021-03-27 09:15:31 +01:00
Kid
61b94fe093
Fix typo in read completion (#7867) 2021-03-26 20:31:03 +01:00
Fabian Homborg
fb7c8c4064 __fish_prepend_sudo: First insert history and then *toggle*
Previously this would only ever insert sudo if it took a commandline
from history, not remove it.

So you would end up with

    sudo sudo apt install
2021-03-26 19:32:14 +01:00
Fabian Homborg
75a4e28e4f Manpage generator: Give better error when we can't understand manpath
This would just say "No paths specified", which is *true*, but then we
typically don't give paths, because we figure out the man path.
2021-03-26 19:32:14 +01:00
Johannes Altmanninger
dc417f58ae completions/aura: remove outdated flag
Commit a0b46e620 ("Update Aura completions") removed "abs", but forgot
it here.

Fixes #7865
2021-03-26 07:49:05 +01:00
Ilan Cosman
bcbfd70d41
Create empty directories and files on interactive startup (#7796)
Closes #7402
2021-03-23 21:01:00 +01:00
Karolina Gontarek
a0f05b376e
Shorten completions for vbc and pydf (#7859) 2021-03-23 20:46:42 +01:00
Jannik Vieten
0f3274d5eb
Fix completion errors for tshark when running as root (#7858) 2021-03-23 20:40:44 +01:00
Johannes Altmanninger
516a70d9cb Misc cleanups
Some as suggested by lgtm.com
2021-03-21 19:41:36 +01:00
Fabian Homborg
95dc821a44 Disable pacman command-not-found handler
Apparently it's too slow on some systems

Fixes #7841.
2021-03-21 10:03:53 +01:00
Olivier FAURE
211f8bc894
Write new completion file for cargo (#7839) 2021-03-20 21:44:38 +01:00
exploide
5eadee61c5 improved SSH completions
- use __fish_complete_ssh also for sftp
- removed old options -1 and -2
- added several newer options
- cleaned up and sorted completion code
2021-03-20 21:17:53 +01:00
Johannes Altmanninger
f9e131aa93 Show an error when "builtin -h" fails to find a man page
Prior to this commit "builtin -h" would silently fail when no
documentation is installed. This happens when running fish without
installing it, or when the docs are not installed.

See #7824
2021-03-15 23:07:08 +01:00
Johannes Altmanninger
582675c96a completions/git: restore forward-compatibility by using "complete -c"
After a fish installation is upgraded to 3.2.0, active shells could
throw an error attempting to load Git completions. It's just a
transient error but also easily avoidable by using the old style.

See #7822
2021-03-15 22:34:30 +01:00
lapingenieur
f95f12f5e7 changed 'rm' to 'command rm'
if rm is aliased to 'rm -i' then rm will ask to delete the cache file after funced edited the file which is anoying
2021-03-15 21:07:39 +01:00
exploide
38cd373ca3 added completions for mkpasswd 2021-03-14 16:46:38 -07:00
Fabian Homborg
3c3bf7ffd7 completions/git: Show recent commits *on all branches* for rebase
Doesn't make a ton of sense for the current branch
2021-03-12 18:12:03 +01:00
Fabian Homborg
873d7f6bb3 completions/git: Add recent commits for rebase
Fixes #7817
2021-03-12 18:10:11 +01:00
Ilya Grigoriev
1a03c23b58 Improve error when help fails to find a browser
Previously, this message told the user to "set $BROWSER and try again". However,
when I first saw this error, I didn't know how I can set `BROWSER` in fish. Moreover,
I often see this error in situations when no browser will work. For instance, I might be
using fish over ssh, and I might either not know whether that system has a text-mode
browser installed or not want to use it.

A further improvement would be to report this message if a browser fails to start.
2021-03-11 18:32:24 +01:00
Fabian Homborg
c23f311956 pythonista prompt: Remove single-argument test 2021-03-11 16:55:17 +01:00
ridiculousfish
7e8b8345e7 Fix some graphical glitches in fish_config
fish_config has some shadows and other elements which don't align
propertly. Fix these, and apply some other miscellaneous polish.

Fixes #7811
2021-03-10 18:46:06 -08:00
Fabian Homborg
dfebfcf376 __fish_apropos: Also add "--" separator
This actually *worked* in my tests which confuses me.

It really shouldn't, `apropos -foo` will complain about "-o" not being
a valid option.

It should be `apropos -- -foo`.

Now, of course there are awful apropos implementations, so let's see
if someone complains
2021-03-10 07:22:17 +01:00
Fabian Homborg
d2fc1c47ac __fish_describe_command: Add missing --
Fixes #7809.
2021-03-10 07:17:23 +01:00
Caroleq
9fe2b27bba
Shorten description in completions (#7788)
* Fix long descriptions in completions

* PR review modifications
2021-03-09 20:28:25 +01:00
exploide
274be5eeeb added descriptions to __fish_print_addresses
added --all flag to include 0.0.0.0 and ::
adapted use of this function in existing completions
fixes #7787
2021-03-08 17:47:29 +01:00
Kid
a85edbfbcd Fix typo in __fish_print_pipestatus 2021-03-07 12:51:57 +01:00
Ilya Grigoriev
fe70c29c48 Incorporate black suggestions & rearrange imports slightly
This isn't really necessary, but it makes the file look nicer to
my eyes. Let me know if you want me to remove this commit.
2021-03-07 09:42:41 +01:00
Ilya Grigoriev
f725cd402d Make help and fish_config work on Chrome OS
When `fish` is running in the Chrome OS Linux VM (Crostini),
both `help` and `fish_config` opened a "file not found"
page. That is because on Crostini, `BROWSER` is usually set to
`garcon-url-handler`, which opens URLs in the host OS Chrome
browser. That browser lacks access to the Linux file system.

This commit fixes these commands. `help` now opens the URL on
www.fishshell.com.  `fish_config` now opens the URL for the
server it starts. Previously, it opened a local file that
redirects to the same URL.

In the case of `help`, the situation could be improved further
by starting a web server to serve help. I don't know of another
way to access `/share/fish` from outside the VM without user
intervention, and I think that might be a part of the security
model for the Crostini VM.

It's hard to write a test for this. I checked that `help math`,
`python2 webconfig.py`, and `python3 webconfig.py` work on my
machine running in Crostini.
2021-03-07 09:42:41 +01:00
Fabian Homborg
10ef0d9daf Fix clipboard_paste nicer
Instead of hacking in arbitrary characters to avoid splitting, just
use `string collect`.

This reverts commit e450190d50.

Fixes #7782, but nicer.
2021-03-06 08:40:07 +01:00
Mahmoud Al-Qudsi
e450190d50 Fix regression causing error and prompt corruption on paste
Closes #7782

[ci skip]
2021-03-05 17:13:28 -06:00
Fabian Homborg
69c71052ef Remove __fish_repaint
This was a handler for various prompt variables that called a repaint.

Unfortunately, if you set one of those *inside* the prompt (a logical
place for it), this would lead to something like #7775.

So, because this isn't actually *useful* as far as I can see (how do
you set these variables in a way that you're not already inside a
prompt or about to draw a prompt? in a key binding?), we remove it,
like we removed the repaint from git's variable handlers.
2021-03-04 19:20:31 +01:00
Fabian Homborg
b1c5e003ef fish_command_not_found: Actually define default handler
Fixes #7777
2021-03-04 18:30:12 +01:00
Jake
ece0aa5324
Update rsync completions (#7763)
* Add rsync flags completion

* Add missing rsync completions

* Remove bracket expansion and fix aka long options

* Improve rsync flags function code

* Replace "newness" with birth for creation times

* Improve rsync version option description

* Clarify rsync append-verify
2021-03-04 18:15:25 +01:00
Fabian Homborg
d85bdf120f fish_add_path: Handle moving multiple arguments correctly
This `set -e` had a cartesian product that caused it to remove the
indexes separately, so the later indexes were off - removing the first
and then the second ends up removing the first and then the
old-*third* which is now the second.

Just quote the expansion so it runs in one go.

Fixes #7776
2021-03-04 16:10:27 +01:00
Fabian Homborg
76457bdc4e fish_git_prompt: Remove repaint from variable handlers
Because we removed repaint coalescing, currently setting any of the
git prompt variables in fish_prompt leads to a repaint loop (that
presumably aborts once it reaches the recursion limit).

Since repainting on these variables isn't really useful (when you
`set` them interactively you already get a new prompt), just remove
it.

There's two cases this "breaks":

- When you set a variable *after* the call to fish_git_prompt
- When you set a variable via a binding

In both of these it's not too much to expect an explicit "commandline
-f repaint", especially since for bindings that's already needed in
most cases, and setting a variable after using it isn't normal.

Fixes #7775.
2021-03-04 15:58:20 +01:00
Fabian Homborg
0a3fec5e8b __fish_print_pipestatus: Reset modifiers again
Called as

__fish_print_pipestatus "[foo" "oof]" "|" (set_color green) (set_color --bold blue) 0 1 2

it would make the closing `oof]` bold green.

Fixes #7771.
2021-03-03 19:20:28 +01:00
exploide
1f3fdf2de6 added hashcat completions 2021-02-28 12:13:58 +01:00
exploide
5ab61dde12 added completions for JohnTheRipper 2021-02-28 12:13:58 +01:00
Brett Jia
384975c892
git: Shorten various long descriptions (#7752)
* Shorten various long descriptions

* Address review comments
2021-02-28 12:12:57 +01:00
Afsar Pasha
9909623262 Fixed __fish_adb_get_devices 2021-02-28 12:12:01 +01:00
Birk Tjelmeland
2719179bc1 Fix pandoc completion error
Pandoc completions would give an error if the folder `~/.pandoc`
does exist. This commit fixes that.
2021-02-27 22:31:42 +08:00
nosed1ve
aa608a42ff
Ensure web_config works on WSL (#7742)
* Ensure web_config works on WSL

web_config could sometimes fail on WSL if the user chose not to append
windows directories to their linux $PATH. This change ensures that the
cmd.exe executable is found in most cases even if windows directories
are not appended to $PATH on linux.

An error message letting the user know that cmd.exe was not found, and
that they should add the cmd.exe dir to their $PATH before running
fish_config is displayed if cmd.exe is still not found.

* Exit with a non 0 status code if cmd.exe is not found
2021-02-25 16:21:34 +01:00
David Adam
39230978b3 docs: call the CHANGELOG "release notes" 2021-02-25 22:46:24 +08:00
Fabian Homborg
b8d28158a6 Do disown the completion updating without $last_pid
In this context, as it stands, $last_pid will give fish's pid (because
of pgroup shenanigans).

Since that doesn't really work, just `disown` without and let fish
figure out what the last process was.

Theoretically this has an issue if someone started a background
process *before* the python script *and* that exits before we run
disown.

That's a vanishingly small window and this is only run on first start,
so it seems acceptable.

Fixes #7739.
2021-02-24 20:30:01 +01:00
ridiculousfish
e7d5a40252 Correct description for 'git worktree lock' description
Fixes #7731.
2021-02-20 11:36:36 -08:00
Jason
1f546ac1d0 abbr: improve error handling when --erase called with no args 2021-02-20 11:33:48 -08:00
Fabian Homborg
477587a4d4 webconfig: Remove more margins on small screens
This still showed the background gradient, which is just a waste and
looks weird.

Instead make the actual content fullscreen (except for the border
radius, for now)
2021-02-15 20:07:24 +01:00
ridiculousfish
c35535dee7 Do not show the history variable in fish_config
The history variable may be so large that it hangs the browser, as
spotted in #7714. Omit this from the variable list.
2021-02-15 10:47:13 -08:00
Johannes Altmanninger
e16a1d7065 Add deprecated compatibility wrapper for __fish_commandline_is_singlequoted
It could be really annoying if Ctrl-V stopped working when switching between
fish versions, for example when using different machines.
2021-02-13 08:55:59 +01:00
Johannes Altmanninger
4c1173f2ae fish_clipboard_paste: trim indentation when pasting multiple lines
When pasting a multiline command with indented blocks, extra indentation
from spaces, or tabs, is generally undesirable, because fish already indents
pipes and blocks. Discard the indentation unless the cursor or the pasted
part is inside quotes.

Users who copied fish_clipboard_paste need to update it because
__fish_commandline_is_singlequoted had an API change and was renamed.
2021-02-13 08:55:59 +01:00
Johannes Altmanninger
f99c275e42 completions/tig: directory completions after -C want a space
Since https://github.com/jonas/tig/releases/tag/tig-2.5.2
2021-02-13 08:07:20 +01:00
exploide
2bab31a316 updated metasploit completions 2021-02-09 23:11:50 +01:00
Johannes Altmanninger
330883b6fd Run fish_indent on share/**.fish
This is mostly to show that some of my following indent changes don't break
current behavior.
2021-02-08 07:31:33 +01:00
Ilya Grigoriev
254729f86d Fix Alt+L when using the "Informative" prompt
I ran into problems described in https://github.com/fish-shell/fish-shell/issues/718 when using this prompt. This seems to be a bug in the prompt -- this change fixes it, at least on my system. 

I tried this in tmux (TERM=screen) and gnome-terminal (TERM=xterm-256) with fish 3.1.2, on Linux.
2021-02-07 08:54:02 +01:00
Fabian Homborg
2a9edfe26e help: Better handle builtins when docs aren't installed
__fish_print_commands just prints the commands we have man pages for,
and help uses that to figure out whether it should link
a command or a section. If the docs aren't installed it won't find
anything.

At least check the builtins, because we document them and it's easy.

This probably needs to be added at build time - glob
doc_src/cmds/*.rst.
2021-02-05 17:19:07 +01:00
Shun Sakai
d8530257c7 Add completions for libavif 2021-02-05 12:25:04 +01:00
Shun Sakai
060e796577 Add completions for the JPEG XL Reference Software 2021-02-05 12:24:23 +01:00
Fabian Homborg
cf4f8ae929 Revert "Color "ip" output if available"
This reverts commit abb59a6ec9.

This is still buffered if piped to another function, like with the default `grep`.

See #5340, #5356.
2021-02-02 18:44:44 +01:00
Johannes Altmanninger
29ee4d318d Do use autogenerated completions for external git subcommands
Some third party Git tools provide a man page, which we can at least use
for completing options.

The old logic excluded all generated completions for Git subcommands.
Instead, try to load completions for all available external subcommands.
We can use $PATH/git-* because /bin/git-add and friends were removed in Git
1.6.0 in 2008.

Closes #4358 (the "git-foo" wrapping was added in #7652)
2021-02-02 07:54:28 +01:00
Johannes Altmanninger
abb59a6ec9 Color "ip" output if available
This is supported since iproute2 v4.19.0

Closes #5340
2021-02-02 06:39:40 +01:00
Fabian Homborg
dd48fdc970 Remove hostname function
This was only a thing in cygwin, and only a workaround because
cygwin's hostname was broken in 2013 and our sample prompts called it,
which caused errors in fish_config.

Our sample prompts no longer call `hostname` at all (they use
`prompt_hostname`, which uses the variable), and it's possible
cygwin's hostname was fixed in the meantime.

Fixes #7669.
2021-01-31 08:36:00 +01:00
Akatsuki Rui
176e6a9ce1
completions/userdbctl: init (#7667)
* completions/userdbctl: init

userdbctl:
    Show user and group information.

A part of systemd.

* completions/userdbctl: fix complete services

Complete the services at the completion time.
2021-01-30 18:25:22 +01:00
Akatsuki Rui
350f6fe350
completions/networkctl: add missing commands (#7668)
* completions/networkctl: add missing commands

* completions/networkctl: fix complete devices

Complete the devices at the completion time.
2021-01-30 18:24:41 +01:00
Fabian Homborg
594d51e7eb Add a separate --profile-startup option to profile startup
This goes to a separate file because that makes option parsing easier
and allows profiling both at the same time.

The "normal" profile now contains only the profile data of the actual
run, which is much more useful - you can now profile a function by
running

   fish -C 'source /path/to/thing' --profile /tmp/thefunction.prof -c 'thefunction'

and won't need to filter out extraneous information.
2021-01-29 20:46:34 +01:00
Johannes Altmanninger
0ed7d67532 completions/git: minor cleanup 2021-01-27 07:31:54 +01:00
Johannes Altmanninger
085c1d2096 completions/git: avoid loading git-foo completions twice
We were soucing it manually, and implicitly via the `complete -C "git-foo "`
wrapper. Always use the latter, so fish knows that the completion is already
loaded.
2021-01-27 07:31:54 +01:00
Fabian Homborg
a78ec8c8cb webconfig: Use flexbox for the colorschemes
This had a classic float:left layout, which led to awkward gaps and
stuff.

Since what we want here is basically 100% exactly a flexbox, just use that.

Note: No flexbox for the prompts, atm, because having multiple of
those next to each other looks a bit weird.
2021-01-26 20:47:18 +01:00
Fabian Homborg
b722e9ae32 sample_prompts/sorin: Move the right prompt into the prompt function
Our old problem with fish_config
2021-01-26 19:23:59 +01:00
Johannes Altmanninger
09161761c1 Complete custom "git-foo" commands from "git foo"
Since #7075, git-foo.fish files are sourced when Git completions are loaded.
However, at least Cobra (CLI framework for Go) provides completions like

	complete git-foo ...

This means that completions are only offered when typing "git-foo <TAB>"
and not on "git foo <TAB>". Fix this by forwarding the completion requests.
Take care to only forward if there are actually completions for "git-foo",
to avoid adding filename completions.
2021-01-25 19:09:56 +01:00
Fabian Homborg
8907606b07
completions/ps: Fix typo
Fixes #7657
2021-01-25 13:22:14 +01:00
Fabian Homborg
28f4f82246 completions/gem: Unbreak
See #7655.
2021-01-24 21:00:50 +01:00
Fabian Homborg
66932b74b2 completions/launchctl: Unbreak
These passed the description as part of the argument but didn't escape
them properly.

Instead, let's just use a description.

Fixes #7655.
2021-01-24 20:08:22 +01:00
Johannes Altmanninger
58df0bc051 __fish_print_pipestatus: remove fallback colors for missing arguments
The arguments were not optional because we use
"set -e argv[1 2 3 4 5]"
2021-01-24 14:28:14 +01:00
Wez Furlong
4b0152575e Enable OSC 7 when running in WezTerm
Over in https://github.com/wez/wezterm/issues/115#issuecomment-765869705 one of my users noted that fish had automatic OSC 7, but that it wasn't enabled under WezTerm.

You can detect WezTerm through the `$TERM_PROGRAM` environment.  In practical terms, all versions of wezterm in the wild support OSC 7 so a version check is not needed.

I'm not a fish user myself, but I did give the equivalent change to this a try on my Fedora 33 machine (it has an older version of fish).

I can see in this file that there's some stuff with `__fish_enable_focus` that you may also want to enable under wezterm; the escape sequence is supported as are panes, tabs and windows.
2021-01-23 18:10:32 +01:00
Fabian Homborg
3eff7b26bf __fish_print_pipestatus: Add missing quotes
If this was called without an argument you'd not have a valid `test`
invocation.

Gosh I hate test.
2021-01-22 21:55:35 +01:00
Fabian Homborg
a407af2944 completions/git: Silence git's errors
This can spew about not finding the ignore file in some circumstances.
2021-01-22 21:54:36 +01:00
Alexander Sieg
ddab61616f
Include completion for all pkg alias subcommands (#7642)
* Include completion for all pkg alias subcommands

* Formatting and dynamic evaluation of alias subcommands

* only set package_name completion once

* fixed syntax error
2021-01-21 18:43:26 +01:00
Akatsuki Rui
1a9835f55e
completions/mtr: init (#7638)
* completions/mtr: init

Add mtr completion.

[ci skip]

* completions/mtr: edit descriptions
2021-01-19 18:09:09 +01:00
Mahmoud Al-Qudsi
e2273bacb2 Separate completions for GNU and BSD ps command
It's not just -F; the majority of options are actually not portable
between the two.

Closes #7545
2021-01-18 14:23:39 -06:00
Fabian Homborg
bc6414aaa8
!fixup fish_git_prompt: Fix variable name
This missed one use of $user_variable
2021-01-18 12:37:30 +01:00
Fabian Homborg
dbfd3b5c39 fish_git_prompt: Remove a few unneeded variables 2021-01-17 21:04:16 +01:00
Johannes Altmanninger
f176503c0f Remove the explicit undo group in fish_clipboard_paste
It doesn't change the behavior, see
7669e8e497 (r45675920)
2021-01-15 20:23:59 +01:00
Johannes Altmanninger
692a8aef03 completions/xargs: provide subcommand completions 2021-01-15 20:23:59 +01:00
Fabian Homborg
e192066e98 Add $fish_handle_reflow to disable winch handler
Overriding event handlers is annoying.
2021-01-15 18:37:06 +01:00
Fabian Homborg
48082daad4 Turn off reflowing for Konsole >= 21.04 as well
See https://bugs.kde.org/show_bug.cgi?id=196998, https://invent.kde.org/utilities/konsole/-/merge_requests/321

Part of #7491.
2021-01-15 18:37:06 +01:00
Ben Woods
1890c848e0
completions: Add support for lightdm and dm-tool commands (#7624) 2021-01-13 14:37:42 +01:00
Henrik Hermansen
1d1e8a54a0 Properly fix git diff check 2021-01-13 14:36:41 +01:00
Henrik Hermansen
eaf7431c38 Fix Git status in Acidhub prompt
Fix 1: The --quiet flag must be at the end of the command. The way it was I would never get any status symbol in my prompt as the command failed.
Fix 2: After adding files to git, but before committing them, git status is unsorted. This gave me the output "M A M A" after `uniq`, which resulted in 4 status symbols instead of 2. Sorting them before filtering them fixed the problem.
2021-01-13 14:36:41 +01:00
Clément Martinez
c76074b1d6 Add losetup completions 2021-01-12 08:22:28 +01:00
exploide
20d91c6be2 added completion script for alternatives 2021-01-10 18:35:46 +01:00
Fabian Homborg
bb3b6e3329 completions/timedatectl: Add missing quotes
Oops!

Supersedes #7617.
2021-01-10 18:33:31 +01:00
Collin Styles
f496b07c7c Fix completion for --exact option to fzf
These double hyphens will make the completion resolve to `----exact`
which isn't a valid option.
2021-01-10 09:17:21 +01:00
Fabian Homborg
168677f8b3 Use disown with $last_pid
As mentioned in 5b706faa73, bare
`disown` has a problem: It disowns the last *existing* job.

Unfortunately, it's easy to see cases where that won't happen:

    sleep 5m &
    /bin/true & # will exit immediately
    disown # will most likely disown *sleep*, not true

So what we do is to pass $last_pid.

In help especially this is likely to occur because many graphical
browsers fork immediately to avoid blocking the terminal (we only
added the backgrounding and disown because some weren't).

Note that it's *possible* this doesn't occur if used in the same
function, but I don't want to rely on those semantics.

It might be worth doing this as the default - see #7210.
2021-01-09 13:44:48 +01:00
Ben Woods
e93996dc01 completions/pkg: Add support for "alias" and "bootstrap" sub-commands 2021-01-08 21:36:29 +01:00
Johannes Altmanninger
0729c2be4c Re-add completions for source and ., to prefer *.fish files
This is mildly useful when activating virtualenvs.  We had remove
these files earlier, but since there are no more false negatives from
__fish_complete_suffix it seems safe to re-add them.
2021-01-07 17:09:05 +01:00
Mahmoud Al-Qudsi
aaaf74cd5b fixup! Add concept of edit groups
Correctly call begin/end-undo-group in fish_clipboard_paste
2021-01-06 16:45:24 -06:00
Mahmoud Al-Qudsi
b5523dbd64 Restrict pkg completions to BSD
0507b04 loosened the FreeBSD-only restriction on `pkg` completions to
!SunOS in order to support DragonFlyBSD. This is overly broad and can
still cause the script to be loaded on systems that we can't
realistically expect to have `pkg` be the FreeBSD pkgng package manager
(especially since `pkg` is a much more generic term when compared to the
likes of `dnf`, `yum`, `deb`, and `apt`).

This patch changes `pkg` + BSD to be the minimum requirements for
considering a system to be using pkgng.
2021-01-05 17:30:50 -06:00
Mahmoud Al-Qudsi
7669e8e497 Add concept of edit groups
This allows for multiple edits to be undone/redone in one go, as if they
were one edit.

Useful when a function is editing the commandline buffer via scripted
changes or via a keybinding so the internal changes to the buffer can be
abstracted away.

(Having extreme difficulty getting pexpect to play nice with the concept
of undo/redo...)
2021-01-05 15:43:34 -06:00
Ben Woods
c1ef9676cb completions/pkg: Add support for "pkg check" sub-command 2021-01-04 21:54:58 +01:00
Fabian Homborg
0507b046ef completions/pkg: Only exit for Solaris, not everything-but-FreeBSD
In e8b6705067 this was made to exit if
not on FreeBSD because Solaris has a tool called "pkg" that apparently
"isn't worth supporting".

Since at least DragonflyBSD also uses FreeBSD's pkg thing, let's turn
that check around.
2021-01-04 17:25:50 +01:00
Edouard Lopez
7c704ce545 use original theme repo URL 2021-01-04 13:54:58 +01:00
Fabian Homborg
768defeb8e webconfig: Stop proscribing a specific font-family
There's a macOS bug with Source Code Pro that makes it unable to be
colored. Since that makes webconfig unusable, stop recommending it.

Instead, we just pick the default monospace font for the system.
2021-01-04 12:23:29 +01:00
Weihang Lo
4116aaeb5f Update rustc.fish
- [`-L`: add a directory to the library search path][1]
- [`--crate-type`: a list of types of crates for the compiler to emit][2]
- [`--emit`: specifies the types of output files to generate][3]

[1]: https://doc.rust-lang.org/stable/rustc/command-line-arguments.html#-l-add-a-directory-to-the-library-search-path
[2]: https://doc.rust-lang.org/stable/rustc/command-line-arguments.html#--crate-type-a-list-of-types-of-crates-for-the-compiler-to-emit
[3]: https://doc.rust-lang.org/stable/rustc/command-line-arguments.html#--emit-specifies-the-types-of-output-files-to-generate
2021-01-03 18:09:50 +01:00
Fabian Homborg
627fff7971 webconfig: Comment utf-8 assumption 2021-01-03 15:48:39 +01:00
Fabian Homborg
17501bcc57 webconfig: Error out on form-data
Just in case this happens anywhere return a sensible error instead of
mishandling it.
2021-01-03 15:27:46 +01:00
Fabian Homborg
e332555596 Webconfig: Remove dependency on cgi module
This is slated for removal in python 3.10, see
https://www.python.org/dev/peps/pep-0594/#cgi.

We currently only use it for three things:

- escape_html in old python versions that didn't have that in the html
  module
- Parsing multipart/form-data
- Figuring out the charset for json

We keep the first one - if loading escape_html from html fails we fall
back to cgi.

We remove the second - I can't find any case where we use
multipart/form-data. Any place we post data we either explicitly pass
application/x-www-form-urlencoded or implicitly use application/json.

The third is the tricky bit. This drops charset detection under the
assumption that we're never going to encounter anything other than
utf-8 (or ascii, which is a utf-8 subset). I'm not sure that holds,
but if it doesn't we can just add a regex to parse the charset.
2021-01-03 15:16:47 +01:00
Ilan Cosman
18940ea086
Remove dunderscores from __fish_status_to_signal (#7597)
* Remove dunderscores from __fish_status_to_signal

* Document fish_status_to_signal

* CHANGELOG: Add fish_status_to_signal

* Add string join to fish_status_to_signal documentation example
2021-01-03 15:15:57 +01:00
Fabian Homborg
f547c2fda8 Webconfig: Fix customizing ayu themes
These used a different object format, so they were passed to
interpret_color wrong.

Because the "common" and "syntax" division doesn't really help all
that much, let's just flatten the thing.

See #7596.
2021-01-02 16:22:12 +01:00
Fabian Homborg
8a585bb711 Also disable winch handling in alacritty
It also reflows.

We might want to think about doing something more extensible here, as
konsole is also about to add reflow, but for now the main problem
children here are VTE and alacritty.

Extends #7491.
2021-01-01 20:22:57 +01:00
Edouard Lopez
c8b400bfad register ayu colorscheme 2021-01-01 11:36:13 +01:00
Edouard Lopez
9272703359 add ayu colorscheme 2021-01-01 11:36:13 +01:00
Johannes Altmanninger
a24ceaf0df completions/git: offer ranges for cherry-pick 2020-12-29 16:31:43 +01:00
Johannes Altmanninger
85830a5775 completions/git: don't sort branches and tags
This seems a bit more intuitive.
2020-12-29 16:31:43 +01:00
Nunzarius
d3de09da83 Added completions for ldapsearch 2020-12-26 12:13:44 -08:00
Johannes Altmanninger
d6dd532d6a Do support the new realpath -s in our wrapper function
See #7574
2020-12-26 08:56:34 +01:00
Johannes Altmanninger
4dae106911 Use complete --keep-order with __fish_complete_suffix to prioritize files with matching suffixes
Part of #7040
2020-12-23 19:14:10 +01:00
Johannes Altmanninger
bae75c96d9 __fish_complete_suffix: complete all files, but sort files with matching suffix first
See #7040 and others.
2020-12-23 19:14:10 +01:00
Johannes Altmanninger
d18e1c7bca Revert "completions/unzip: Stop filtering suffixes"
This reverts commit 46068cd257.
2020-12-23 19:14:10 +01:00
Fabian Homborg
04d7d89020 __fish_print_packages: Extract the rest
Of note: The rpm/yum thing seems to be coupled, so I put it into one
function that tries the yum helper and uses the rpm path otherwise.
Zypper is already its own thing, so this should only be used for yum
and probably dnf (does that still have the helper?)

Zypper can be dropped, as that already used a separate function in the file.

Apk can just be inlined - it's literally one line for installed and another for all packages.
2020-12-22 17:10:02 +01:00
Fabian Homborg
cf59c3b680 completions/eopkg: Rework some comments 2020-12-22 17:10:02 +01:00
Fabian Homborg
97838657b9 Extract creating $XDG_CACHE_HOME into its own function 2020-12-22 17:10:02 +01:00
Fabian Homborg
24012b1941 __fish_print_packages: Break apart
This function doesn't make any sense.

Most things that expect package names expect package names for *one
specific package manager*.

It only happens to work, most of the time, because most people only
have one package manager installed.
2020-12-22 17:10:02 +01:00
Nunzarius
f7966b3249 Added completions 2020-12-22 17:06:27 +01:00
Ivan Tham
c5343a538f Add cargo abbr completions 2020-12-21 23:05:31 +01:00
Shun Sakai
58d9fa3820 Add completions for .NET 2020-12-19 16:55:24 -08:00
ridiculousfish
90f4c458e5 Rename insert_line_above to insert_line_over
This is for symmetry with insert_line_under. See #7442.
2020-12-19 14:31:33 -08:00
ridiculousfish
2d2efc8b2e Implement o and O bindings for vi mode
Credit to @joallard for the patch. Fixes #7442
2020-12-19 14:28:00 -08:00
Fabian Homborg
75dcbed700 Remove some useless uses of no-scope-shadowing
This is a very delicate tool, and these completions simply don't need them.
2020-12-16 18:31:51 +01:00
Jason
b0dcfac2a0 Update find.fish 2020-12-15 14:42:03 +01:00
Fabian Homborg
edbb8ad0a4 completions/fish: Add --debug-output, remove debug levels
The levels don't do anything anymore, so we can remove them.
2020-12-14 19:36:18 +01:00
Fabian Homborg
6e9364ab50 fish_indent: Change --debug-level to --debug with flog categories
The "debug-level" flag makes little sense since we have no more
debug *levels* left.
2020-12-14 19:36:18 +01:00
Daniel Hoekwater
e8dcef5a71
completions: Fix some more overlong descriptions (#7550)
* Fix overlong completion descriptions for wget

* Fix overlong completion descriptions for valgrind

* Fix overlong completion descriptions for mocha

* Fix overlong completion descriptions for adduser

* Shorten and clean up completion descriptions
2020-12-14 19:01:04 +01:00
Fabian Homborg
c065d24632 completions: More short descriptions
Work on #6981.
2020-12-14 17:42:04 +01:00
Johannes Altmanninger
f1478137dc __fish_complete_path: guard against non-matching input 2020-12-12 08:22:45 +01:00
Johannes Altmanninger
f0f21bdecd Minor refactoring to __fish_git_local_branches 2020-12-12 08:22:24 +01:00
Jason
7e3d3cc30f completions: git switch only takes branch names
Trying to switch to a remote branch like "upstream/ver2" will error with "fatal: a branch is expected, got remote branch 'upstream/ver2'", so these completions should only print the branch name. There doesn't seem to be a function for printing just the branch names for remotes (branch names can have forward-slashes in them), so I have just left them out for now.
2020-12-12 07:19:55 +01:00
Fabian Homborg
952f1971ad completions/mount: Allow files
This can use files/directories in a variety of ways, and it's
basically impossible to enumerate all of them - basically *any file*
could be mounted, if only there is a filesystem for it.

We still give the blockdevices and predefined mountpoints, so they can
still be used.
2020-12-11 23:09:16 +01:00
Fabian Homborg
0fdef958b6 __fish_complete_blockdevice: Default to /dev
This gives all the blockdevices for `mount `

Fixes #7543.
2020-12-11 23:09:16 +01:00
Fabian Homborg
2aaa51e02e Repaint also for fish_color_{host_remote,error}
These are used in our prompts as well.
2020-12-11 20:55:09 +01:00
Fabian Homborg
a4e2a3c049 Reformat web_config css with prettier
I'm not a fan of how prettier formats code, but this file was a mess
with inconsistent indentation, and the result is okay.

[ci skip]
2020-12-10 16:27:00 +01:00
Fabian Homborg
1d7978d282 web_config/colors: Fix div tag
This wasn't closed correctly, and by closed I mean it lacked a `>`.

[ci skip]
2020-12-10 16:27:00 +01:00
Vadim Zyamalov
0200fc0fbc
Creating cache for xbps-query in __fish_print_packages.fish (#7534)
* Completions for xbps were not showed on cache file creation

* Completions for xbps were not showed on cache file creation, small typo
2020-12-08 20:59:56 +01:00
Fabian Homborg
ab5d7f80d0 Restyle codebase
And again clang-format does something I don't like:

-    if (found != end && std::strncmp(found->name, name, len) == 0 && found->name[len] == 0) return found;
+    if (found != end && std::strncmp(found->name, name, len) == 0 && found->name[len] == 0)
+        return found;

I *know* this is a bit of a long line. I would still quite like having
no brace-less multi-line if *ever*. Either put the body on the same
line, or add braces.

Blergh
2020-12-06 15:39:54 +01:00
Jason
9140fc7931
pactl completions: guard call to other pulseaudio tools (#7532)
At least on Arch Linux, pacmd and pulseaudio aren't necessarily available just because pactl is (pipewire is now a thing, and it installs libpulse but not pulseaudio)
2020-12-06 14:54:41 +01:00
Mahmoud Al-Qudsi
a614a19b07 [apt] Dynamic completions for source repo
Dynamically complete the possible candidates for `apt install -t <repo>`
by "parsing" the installed configuration files.

[ci skip]
2020-12-05 10:45:04 -06:00
Fabian Homborg
d9b7cdc43b Webconfig: Move the style to the body, not the ancestor
This allow box shadows to work and removes the last margins when under
700px wide.

I'm not entirely sure we need the ancestor anymore.
2020-12-05 14:47:26 +01:00
Fabian Homborg
96dd8d511e Webconfig: Let it work better on small screens
This allows it to basically work down to quite small widths.
2020-12-04 17:08:45 +01:00