Commit Graph

3925 Commits

Author SHA1 Message Date
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