Commit Graph

15417 Commits

Author SHA1 Message Date
Fabian Homborg
666032abbd Translate command-not-found message
I have no idea why this function is defined twice.
2022-03-17 18:19:03 +01:00
pagedown
47294f4d29 Add kitty to __update_cwd_osc 2022-03-17 18:17:42 +01:00
Evan Benn
f7faf0fcf7 Reorder git checkout completions
Multiple complete -k -a arguments are ordered last first. Reorder the
completions to list branches first, then tags and then finally commits.
2022-03-17 18:15:44 +01:00
Fabian Homborg
fb283cfe4a Move $__fish_initialized to config_interactive
This is no longer used in share/config.fish, and it's quite cheesy.

The only thing we use it for is defaulting the colorscheme.
2022-03-17 18:15:11 +01:00
Fabian Homborg
49c16cc9a6 Stop migrating old abbrs
This tried migrating old abbreviations *twice* - once from the 2.3
scheme to the 2.4 one, and once from that to the 3.0 scheme.

Since this is purely for upgrading from fishes < 3.0, and basically
untested, let's remove it.

If anyone does that upgrade, they'll simply have to reexecute the abbrs.
2022-03-17 18:15:11 +01:00
Fabian Homborg
d751b00504 Remove getifaddrs check
Not used anymore
2022-03-17 18:15:11 +01:00
Fabian Homborg
ef28931293 Stop migrating legacy uvar paths
These were changed in fish 3.0 in December 2018.

This means upgrading from fish 2.7.1 or earlier to the next fish
version will require users to set their universal variable again.
2022-03-17 18:15:11 +01:00
Fabian Homborg
a7b80c9881 Remove misleading comment 2022-03-17 18:15:11 +01:00
Fabian Homborg
03c188086c Remove wcsndup and wcslcpy
We no longer use these anywhere.
2022-03-17 18:15:11 +01:00
Fabian Homborg
753f29df4c Stringify reformat_for_screen
This is the only usage of wcsndup, and we can just use wcstring::substr.
2022-03-17 18:15:11 +01:00
Fabian Homborg
71cfd25c1d Command-not-found: Warn if a file exists but isn't executable
This simply adds a nice error so you can better see if your command
isn't available because it's not executable.

Fixes #8804.
2022-03-17 18:06:36 +01:00
Edward Betts
dc4e88d7b4 Fix a typo 2022-03-16 20:02:09 -07:00
AJ
fd84e07320 completions: fix long tmutil.fish descriptions #6981
Reduce `tmutil.fish: tmutil -n __fish_use_subcommand -a localsnapshot -d` to 66 characters.
2022-03-16 20:29:00 +01:00
AJ
fcfa72e5fc Update mix.fish
Update `mix.fish` autocomplete to shorter description (60 characters). Addresses `mix.fish` Issue #6981
2022-03-16 20:28:27 +01:00
Fabian Homborg
2f7a73381a CHANGELOG 2022-03-16 20:16:05 +01:00
Fabian Homborg
534646f9d3 read: Actually only fire fish_read, not fish_prompt event
Fixes #8797.
2022-03-16 20:14:59 +01:00
Fabian Homborg
4e2ce0af4e pwd: Add newline to error message
This would keep the cursor on the same line, which is annoying.
2022-03-16 19:20:58 +01:00
aj
d2225e5ce7 remove heroku-two-factor as it is deprecated per: https://github.com/heroku/heroku-two-factor
update complete $heroku_looking -xa git:clone to make it as short as possible without losing meaning.
2022-03-15 19:19:49 +01:00
Fabian Homborg
d34ebe94ca CHANGELOG 2022-03-15 17:39:44 +01:00
Radu Potop
2884b27367
Astronaut prompt theme (#8775)
* Added initial commit for the Starfish prompt theme

* Respect cwd colors

* Corrected typo

* Renamed theme to Astronaut

* Fixed cwd_color for root

* Allow longer dir names, fix variable setting
2022-03-15 17:06:00 +01:00
Missu
30dcd18afb
Add completion for tuned-adm (#8760)
* Add completion for `tuned-adm`

This is part of `tuned` package

* Update tuned-adm.fish
2022-03-15 17:05:06 +01:00
Missu
280727073a
Add completion for brightnessctl (#8758)
* Add completion for `brightnessctl`

* Update brightnessctl.fish
2022-03-15 17:04:31 +01:00
Fabian Homborg
c5a8764db1 Use old-school "()" command substitution in fish_title
Because we reload changed function files, a common issue on upgrading
to 3.4.0 is that fish_title causes errors.

So we simply use the oldschool syntax.
2022-03-14 18:15:06 +01:00
Fabian Homborg
695e20c47f Fix build on NetBSD
This missed a change to "dir_remoteness_t" from bool

Fixes #8788
2022-03-14 18:13:39 +01:00
Fabian Homborg
a76ed9942d Fix tparm kludge
This just defines a constant to whichever tparm implementation we're
using (either the actual, working one the system provides, or our
kludge to paper over Solaris' inadequacies).

This means that there won't be so much ping-ponging of what "tparm"
stands for. "tparm" is the system's function. Only we don't use it,
just like we don't use wcstod directly.

Fixes #8780
2022-03-14 15:36:17 +01:00
Fabian Homborg
cd62771d12 read: Don't use chunking read with --line
Fixes a regression from #8552.
2022-03-14 08:04:35 +01:00
Andrey Mishchenko
dc5bdda8e0 Remove underscores-in-math-builtin entry from 3.4 changelog 2022-03-13 19:24:54 +01:00
Fabian Homborg
97127c3e03 CHANGELOG 2022-03-13 11:49:39 +01:00
Fabian Homborg
8bcb034422 Disable tmux-history-search test on GH Actions 2022-03-13 11:48:52 +01:00
joao-vitor-sr
4ae4ea0169
New -n flag for string join. (#8774)
* New -n flag for string join command.

This is an argument that excludes empty result items. Fixes #8351

* New documentation for string-join.

The new argument --no-empty was added at string-join manpage.

* New completions for the new -n flag for string join.

* Remove the documentation of the new -n flag of string join0

The reason to remove this new argument in the join0 is that this flag basically doesn't make any difference in the join0.

* Refactor the validation for the string join.

The string join command was using the length of the argument, this commit changes the validation to use the empty function.

* Revert #4b56ab452

The reason for the revert is thath the build broke on the ubuntu in the Github actions.

* Revert #e72e239a1

The reason the compilation on GitHub broke is that the test was weird, it didn't even run it, Common CI systems are typically very very resource-constrained.

* Resolve conflicts in the string-join.rst.

* Resolve conflicts in the "string-join.rst".

commit #1242d0fd7 not fixed all conflicts.
2022-03-13 11:47:33 +01:00
Fabian Homborg
ffdbc5a1b2 CHANGELOG 2022-03-13 11:41:38 +01:00
Fabian Homborg
a7859191b2 Remove is_color_escape_seq
This is supposed to detect color escape sequences, to figure out how
long an escape sequence is, for use in width calculations.

However, the typical color sequences are already taken care of by
is_csi_style_escape_seq because they look like a csi sequence starting
with `\e[` and ending in `m`.

In the entire terminfo database shipped with ncurses 6.3, these are
the terminals that have non-csi color sequences:

at-color
atari-color
atari_st-color
d220-dg
d230-dg
d230c-dg
d430-dg
d430-unix
d430-unix-25
d430-unix-s
d430-unix-sr
d430-unix-w
d430c-dg
d430c-unix
d430c-unix-25
d430c-unix-s
d430c-unix-sr
d430c-unix-w
d470-dg
d470c-dg
dg+fixed
dgmode+color
dgmode+color8
dgunix+fixed
emu
fbterm
i3164
ibm3164
linux-m1b
linux-m2
minitel1
minitel1b
putty-m1b
putty-m2
st52-color
tt52
tw52
tw52-color
xterm-8bit

Most of these were discontinued in the 90s and their manufacturers no
longer exist (like Data General, which went defunct in 1999). The last one is a special mode for xterm that is
fundamentally UTF-8 incompatible because it encodes a CSI as \X9b.

The linux/putty m1b and m2 entries (also for minitel) don't support
color to begin with and the sequences they have in their terminfo
entries are control characters anyway, so the calculation would still
add up.

In turn, what we gain from this is much faster width calculations with
unrecognized escapes -
e.g. `string length -V \efoo` is sped up by a factor of 20.

An alternative would be to skip this if max_colors is > 16 as that is
the most any of these entries can do. The runtime scales linearly with
the number of colors so on those systems it would be reasonably quick anyway.

But given just *how* outdated these are I believe it is okay to just
remove support outright. I do not believe anyone has ever run fish on
any of these.
2022-03-13 11:32:53 +01:00
Fabian Homborg
ba8cbf877f
Merge pull request #8646 from juntuu/te-refactor
Variadic functions for `math` and tinyexpr rewrite.
2022-03-13 11:32:32 +01:00
Fabian Homborg
972752aa1c
Merge branch 'master' into te-refactor 2022-03-13 11:24:31 +01:00
Andrey Mishchenko
59e50f77bc
Allow underscores as separators in the math builtin (#8611)
* Implement fish_wcstod_underscores

* Add fish_wcstod_underscores unit tests

* Switch to using fish_wcstod_underscores in tinyexpr

* Add tests for math builtin underscore separator functionality

* Add documentation for underscore separators for math builtin

* Add a changelog entry for underscore numeric separators
2022-03-13 11:23:35 +01:00
Fabian Homborg
9ada7d9aad read: Also read in chunks when directly redirected
We can't always read in chunks because we often can't bear to
overread:

```fish
echo foo\nbar | begin
    read -l foo
    read -l bar
end
```

needs to have the first read read `foo` and the second read `bar`. So
here we can only read one byte at a time.

However, when we are directly redirected:

```fish
echo foo | read foo
```

we can, because the data is only for us anyway. The stream will be
closed after, so anything not read just goes away. Nobody else is
there to read.

This dramatically speeds up `read` of long lines through a pipe. How
much depends on the length of the line.

With lines of 5000 characters it's about 15x, with lines of 50
characters about 2x, lines of 5 characters about 1.07x.

See #8542.
2022-03-13 11:22:48 +01:00
Fabian Homborg
a0e639e1fa read: Remove super old TODO
This was never a problem. If we need it, it's in the git log
2022-03-13 11:22:48 +01:00
Fabian Homborg
9172ab5983
Merge pull request #8473 from krobelus/string-preserve-missing-newline
builtin string: don't print final newline if it's missing from stdin
2022-03-13 11:22:18 +01:00
Fabian Homborg
585d1de653
Merge branch 'master' into string-preserve-missing-newline 2022-03-13 11:21:53 +01:00
David Adam
c7e4350ab6 Release 3.4.0
Fixes #8092.
2022-03-12 22:30:41 +08:00
David Adam
c6d68b4593 CHANGELOG: work on 3.4.0 2022-03-12 22:28:54 +08:00
Ilan Cosman
1edb642abe Ignore own PR 2022-03-12 22:25:33 +08:00
Ilan Cosman
1e714f9d13 Changelog for 3.4 2022-03-12 22:25:33 +08:00
David Adam
4bc6b36bed string docs: format options and arguments in line with other pages
There are a number of items which don't fit cleanly into the styles used in the
synopses, and have been left alone.
2022-03-12 22:22:02 +08:00
Fabian Homborg
a6d484836e docs: Align text left
Otherwise this does "justify", which in bad cases can spread the text
over the width of the whole line, leaving awkward space between words.

This looks something like

```
The    main    file    is    ~/.config/fish/config.fish
```

The current python docs theme also left-aligns.
2022-03-11 20:14:47 +01:00
Fabian Homborg
9575f0eb4f docs: Readd link to full configuration section to index 2022-03-11 19:13:50 +01:00
Fabian Homborg
838056fe18 docs: Remove prompt from multiline commands
If a code block includes a line starting with ">", we assume it shows
an interactive session, all lines starting with ">" are commands and
the rest is output.

Unfortunately, in something like:

```
> for val in $PATh
    echo "entry: $val"
  end

entry: /usr/bin
```

this won't highlight the dangling lines. We could also prefix them
with `>`, but that require us to parse them in blocks or the `end`
would be an error.

So, for now, simply don't give these as a prompt but as a script with
cheesy comments describing the output.
2022-03-11 19:05:26 +01:00
David Adam
3a23fdf359 docs: omnibus cleanup
Includes harmonizing the display of options and arguments, standardising
terminology, using the envvar directive more broadly, adding help options to all
commands that support them, simplifying some language, and tidying up multiple
formatting issues.

string documentation is not changed.
2022-03-12 00:21:13 +08:00
David Adam
e23e52a8e9 docs: standardise on definition lists for options
Harmonizes the option listing including formatting in a similar manner to the
synopsis of each entry.
2022-03-12 00:21:12 +08:00
Fabian Homborg
cf85bf9be3 Let function-scoped variables be queried
This uses the same logic we use to create the variables to find them -
go through the scopes, the topmost local scope *is* function-scope.

Fixes #8684
2022-03-10 18:28:50 +01:00