Commit Graph

395 Commits

Author SHA1 Message Date
Lily Ballard
181e44d331 Invert the flag for string collect
Instead of requiring a flag to enable newline trimming, invert it so the
flag (now `--no-trim-newlines`) disables newline trimming. This way our
default behavior matches that of sh's `"$(cmd)"`.

Also change newline trimming to trim all newlines instead of just one,
again to match sh's behavior.
2019-06-16 16:40:14 -07:00
Lily Ballard
b41e5cbbb7 Add string collect
The `string collect` subcommand behaves quite similarly in practice to
`string split0 -m 0` in that it doesn't split its output, but it also
takes an optional `--trim-newline` flag to trim a single trailing
newline off of the output.

See issue #159.
2019-06-16 15:51:57 -07:00
Fabian Homborg
5e78d6dcc9 CHANGELOG math "x"
[ci skip]
2019-06-10 18:46:06 +02:00
Fabian Homborg
d1d5716ae1 CHANGELOG read history
[ci skip]
2019-06-06 19:14:11 +02:00
Fabian Homborg
77be5b05c6 CHANGELOG complete -F
[ci skip]
2019-05-30 19:20:15 +02:00
Fabian Homborg
97507a24a2 Increase default read limit to 100MiB
Someone has hit the 10MiB limit (and of course it's the number of
javascript packages), and we don't handle it fantastically currently.

And even though you can't pass a variable of that size in one go, it's
plausible that someone might do it in multiple passes.

See #5267.
2019-05-29 11:01:45 +02:00
Fabian Homborg
7086ba43c8 CHANGELOG: Arbitrarily reorder notable fixes
This is roughly in order of importance.

Buffering is really quite nice, $pipestatus is a new thing, $PATH was
a big hubhub, people seem to like eval...

[ci skip]
2019-05-28 22:28:45 +02:00
Fabian Homborg
1e9ec8739b CHANGELOG: Clarify message about parser errors, fix commit
3e055f does not exist. I'm assuming it's
b2a1da602f.

Unfortunately, I'm not entirely sure what kind of parser errors
weren't propagated, so this note isn't all that useful.

[ci skip]
2019-05-28 22:24:47 +02:00
ridiculousfish
63a16befd4 Introduce the fish log, a replacement for debug()
This adds a new mechanism for logging, intended to replace debug().

The entry points are FLOG and FLOGF. FLOG can be used to log a sequence of
arguments, FLOGF is for printf-style formatted strings.

Each call to FLOG and FLOGF requires a category. If logging for a category
is not enabled, there is no effect (and arguments are not evaluated).

Categories may be enabled on the command line via the -d option.
2019-05-27 17:24:52 -07:00
Fabian Homborg
967c1d51ee Only do brace expansion if they contain a variable or ","
Brace expansion with single words in it is quite useless - `HEAD@{0}`
expanding to `HEAD@0` breaks git.

So we complicate the rule slightly - if there is no variable expansion
or "," inside of braces, they are just treated as literal braces.

Note that this is technically backwards-incompatible, because

    echo foo{0}

will now print `foo{0}` instead of `foo0`. However that's a
technicality because the braces were literally useless in that case.

Our tests needed to be adjusted, but that's because they are meant to
exercise this in weird ways.

I don't believe this will break any code in practice.

Fixes #5869.
2019-05-19 18:23:27 +02:00
Dawid Dziurla
0b3bb0e7c1 Underline every valid entered path (#5872)
* src/highlight: Underline every valid entered path

* update CHANGELOG

* fix highlight test
2019-05-19 10:03:56 +02:00
Fabian Homborg
8f3f4bbc9c CHANGELOG fish_indent semicolons and test stacktrace
[ci skip]
2019-05-05 15:22:01 +02:00
Fabian Homborg
8c9359fdd4 src/builtin_argparse: Add --ignore-unknown flag
This keeps all unknown options in $argv, so

```fish
argparse -i a/alpha -- -a banana -o val -w
```

results in $_flag_a set to banana, and $argv set to `-o val -w`.

This allows users to use multiple argparse passes, or to simply avoid
specifying all options e.g. in completions - `systemctl` has 46 of
them, most not having any effect on the completions.

Fixes #5367.
2019-04-29 15:57:56 +02:00
Fabian Homborg
af0e08e9f1 argparse: Use the current function name by default
This makes the `--name` option usually unnecessary.

See #5835.
2019-04-27 15:55:49 +02:00
Fabian Homborg
94ece96bce CHANGELOG path-component
I should really add this immediately.

[ci skip]
2019-04-26 19:17:27 +02:00
Fabian Homborg
ebf1914a35 CHANGELOG complete -C change
[ci skip]
2019-04-26 16:11:43 +02:00
Mahmoud Al-Qudsi
a9e0990773 Add changelog note about parser error propagation fix
..as this affects backwards compatibility (as witnessed by the tests
that failed after making this fix).
2019-04-13 17:28:16 -05:00
David Adam
56125f73e4 env: trigger locale updates if LOCPATH changes
Closes #5815.
2019-04-13 21:58:54 +08:00
Mahmoud Al-Qudsi
b82fa187ea Changelog: mention changes to eval scoping 2019-04-11 11:55:12 -05:00
Fabian Homborg
ab92baf671 CHANGELOG repaint-mode
[ci skip]
2019-04-01 16:14:00 +02:00
Fabian Homborg
bc958712e4 CHANGELOG INTERNAL_WCWIDTH
[ci skip]
2019-04-01 16:02:09 +02:00
Fabian Homborg
90958f2402 CHANGELOG $PATH reordering
[ci skip]
2019-03-30 21:25:27 +01:00
Fabian Homborg
21d8b465cc nextd/prevd: Print BEL instead of "Hit end of history"
That message is just hugely annoying.

Hat-tip to @floam and d524bad5f16b5a18c22fefe440.
2019-03-28 11:58:53 +01:00
Fabian Homborg
54156845e4 CHANGELOG error changes
[ci skip]
2019-03-26 19:33:26 +01:00
Fabian Homborg
b86200938f Always use "." for cd
Nobody doesn't want to use $PWD to cd, so if $CDPATH does not include
it that was a mistake.

Bash also appends "." here.

Fixes #4484.
2019-03-26 10:11:36 +01:00
ridiculousfish
93d70fae11 Relnote stop buffering deferred function processes 2019-03-24 21:39:39 -07:00
Mahmoud Al-Qudsi
a1cba81d13 Add note about console session improvements to CHANGELOG 2019-03-20 21:47:34 -05:00
Fabian Homborg
0bde698f81 printf: Don't die on incomplete conversions
POSIX dictates here that incomplete conversions, like in

    printf %d\n 15.2

or

    printf %d 14g

are still printed along with any error.

This seems alright, as it allows users to silence stderr to accept incomplete conversions.

This commit implements it, but what's a bit weird is the ordering between stdout and stderr,
causing the error to be printed _after_, like

    15
    14
    15.1: value not completely converted
    14,2: value not completely converted

but that seems like a general issue with how we buffer the streams.

(I know that nonfatal_error is a copy of most of fatal_error - I tried
differently, and va_* is weird)

Fixes #5532.
2019-03-17 17:00:55 +01:00
Fabian Homborg
ef2fe0dfa0 CHANGELOG string backslashes 2019-03-15 15:22:59 +01:00
Fabian Homborg
b3f39096e7 CHANGELOG count from stdin
[ci skip]
2019-03-15 14:31:36 +01:00
Fabian Homborg
028112e535 CHANGELOG: Add "scripting improvements" paragraph
It felt weird to put `math --scale` under "interactive", and it's not
a syntax change, new command or particularly notable either.
2019-03-13 12:39:08 +01:00
Fabian Homborg
b792290c51 CHANGELOG pasting leading spaces 2019-03-13 12:39:08 +01:00
Fabian Homborg
ecfe4acd0c complete: Do fuzzy match for --do-complete
This only did prefix matching, which is generally less useful.

All existing users _should_ be okay with this since they want to
provide completions.

Fixes #5467.
Fixes #2318.
2019-03-12 20:27:20 +01:00
hyperfekt
8a0d794337 fish_git_prompt: optionally show stash state in informative mode 2019-03-12 18:47:28 +01:00
Aaron Gyes
5938f02db1
Update CHANGELOG.md 2019-03-09 07:41:46 -08:00
Fabian Homborg
49ba7f8c01 Update CHANGELOG 2019-03-07 22:50:18 +01:00
Fabian Homborg
fe029d4d27 CHANGELOG: Remove reverted fix for read in fish_title
11009de431 reverted
b247c8d9ad because it did not work.

[ci skip]
2019-03-05 10:44:11 +01:00
David Adam
d0394fd301 configure/Makefile.in: drop Autotools build
Removes the autoconf-based build system and its artefacts, updates git metadata and removes the
autoconf-based build from the README.
2019-02-28 22:03:57 +11:00
Fabian Homborg
47ff060b89 string: Fix split0 return status
It turns out that `string split0` didn't actually ever do any
splitting. The arg_iterator_t already split stdin on NUL, and split0 just
performed an additional search that could never succeed (since
arguments from argv already can't contain NUL).

Let the arg_iterator_t not perform any splitting if asked, and then
let split0 split in 0.

One slight wart is that split0 ignores a trailing NUL, which normal
split doesn't.

Fixes #5701.
2019-02-26 20:03:40 +01:00
David Adam
1711883e90 Merge branch 'Integration_3.0.2'
Resynchronize the CHANGELOG.
2019-02-26 13:53:22 +08:00
Kevin Konrad
0f6b3fd9e4 add completions for cf and bosh 2019-02-25 09:00:42 -08:00
zabereer
2c8abdf5cb add $pipestatus support 2019-02-24 21:46:52 -08:00
George Christou
de0b64409c Teach autosuggestions to respect forward-bigword
Closes #5336
2019-02-20 16:06:38 -08:00
David Adam
28f57aa8ab Bump version for 3.0.2 2019-02-19 21:39:17 +08:00
David Adam
6e24061468 CHANGELOG: updates for 3.0.2 2019-02-19 21:30:49 +08:00
ridiculousfish
5c994b0d47 Only inherit a PWD if it resolves to "."
Fixes #5647
2019-02-18 14:32:15 -08:00
Mahmoud Al-Qudsi
e707c530ee Add note about b247c8d9ad to CHANGELOG
There isn't an issue explicitly associated with this, so it'll probably
get lost.

[ci skip]
2019-02-13 16:45:25 -06:00
Fabian Homborg
ca5b7c0ec4 math: Allow --scale=max 2019-02-13 12:54:58 +01:00
Andrew Childs
56309f1c2e Only invoke path_helper in login shells
Matches upstream path_helper which is invoked in /etc/profile and only
applies to login shells. Enables running interactive, non-login shells
with altered PATH values.

Reverts change in c0f832a7, which reverts change in adbaddf.
2019-02-13 00:02:03 -08:00
Fabian Homborg
c588d58663 CHANGELOG: Add -q
[ci skip]
2019-02-12 20:34:19 +01:00
David Adam
43002f1822 Merge branch 'Integration_3.0.1'
Re-sync CHANGELOG.md
2019-02-12 12:15:54 +08:00
David Adam
e26ab3d81c Bump version for 3.0.1 2019-02-11 20:13:15 +08:00
David Adam
339b195e74 CHANGELOG: updates for 3.0.1 2019-02-11 20:13:15 +08:00
ridiculousfish
1701e2c558 Revert "add $pipestatus support"
This reverts commit ec290209db.
2019-02-10 13:46:58 -08:00
zabereer
ec290209db add $pipestatus support 2019-02-10 13:30:40 -08:00
Fabian Homborg
b7e0f14fe0 CHANGELOG: vcs prompt renamination 2019-02-10 14:44:50 +01:00
David Adam
be47d46e6a CHANGELOG: updates for 3.0.1 2019-02-10 17:07:59 +08:00
Fabian Homborg
7c8b444927 Reduce default escape delay
300ms was waaay too long, and even 100ms wasn't necessary.

Emacs' evil mode uses 10ms (0.01s), so let's stay a tad higher in case
some terminals are slow.

If anyone really wants to be able to type alt+h with escape, let them
raise the timeout.

Fixes #3904.
2019-02-07 12:19:36 +01:00
Birger J. Nordølum
df375ea12d brew.fish: Add update-reset subcommand completion (#5608)
* brew.fish: Add `update-reset` subcommand

This command resets all tap's remotes to the latest available upstream.  Ideal for debugging before reporting bugs or just housekeeping.
 
Add missing newlines.

* Add `brew.fish` changes to CHANGELOG.md
2019-02-01 18:02:05 +01:00
Fabian Homborg
0e282deb92 CHANGELOG: Vi-mode-spinning
The last bit for 3.0.1

[ci skip]
2019-01-28 21:26:41 +01:00
Fabian Homborg
a958617425 CHANGELOG: Vi-mode-spinning
The last bit for 3.0.1

[ci skip]
2019-01-28 21:26:10 +01:00
ridiculousfish
0047523cf4 Relnote new pager color options 2019-01-26 16:33:30 -08:00
Fabian Homborg
6b060a54e3 CHANGELOG: Add the PRs
I missed the PRs without associated issue.

[ci skip]
2019-01-26 21:37:00 +01:00
Fabian Homborg
f01e8d9afe CHANGELOG: Update for 3.0.1
This should now contain all closed issues for 3.0.1.

[ci skip]
2019-01-26 21:36:59 +01:00
Fabian Homborg
368787060b CHANGELOG: Add the PRs
I missed the PRs without associated issue.

[ci skip]
2019-01-26 21:36:27 +01:00
Fabian Homborg
0d0a686ea2 CHANGELOG: Update for 3.0.1
This should now contain all closed issues for 3.0.1.

[ci skip]
2019-01-26 21:34:51 +01:00
ridiculousfish
6bd3474daf Make control-S begin navigating the pager contents
In addition to showing the search field, actually allow the user to type in
it.
2019-01-22 14:43:44 -08:00
ridiculousfish
87b7b6b2bb Make control-S begin navigating the pager contents
In addition to showing the search field, actually allow the user to type in
it.
2019-01-22 14:41:13 -08:00
Fabian Homborg
e97c27c177 CHANGELOG: Remove erroneous second "set --show" entry
This was added in 2.7.0 (confirmed by checking the tag), and it
already has an entry there, so the second entry in 3.0.0 is wrong.

[ci skip]
2019-01-22 21:55:19 +01:00
Mahmoud Al-Qudsi
07e03dd794 Release notes for #5426 2019-01-21 20:08:38 -06:00
David Adam
b6aafda139 CHANGELOG: 3.0.1 verbiage 2019-01-21 17:25:24 +11:00
ridiculousfish
5f7adb3c69 Relnote fix for #5481 2019-01-20 18:05:07 -08:00
ridiculousfish
028bff7b44 Relnote fix for #5519 2019-01-20 17:46:19 -08:00
ridiculousfish
1d21e3f470 Make while loops evaluate to the last executed command status
A while loop now evaluates to the last executed command in the body, or
zero if the loop body is empty. This matches POSIX semantics.

Add a bunch of tricky tests.

See #4982
2019-01-20 16:41:59 -08:00
ridiculousfish
1680b741b2 Make while loops evaluate to the last executed command status
A while loop now evaluates to the last executed command in the body, or
zero if the loop body is empty. This matches POSIX semantics.

Add a bunch of tricky tests.

See #4982
2019-01-20 16:37:20 -08:00
ridiculousfish
e490372fbf Relnote fix for #5449 2019-01-20 13:56:42 -08:00
ridiculousfish
f4351eb0f3 Relnote fix for #5449 in 3.0.1 2019-01-20 13:55:18 -08:00
John McKay
827bce6c88 Use mandoc when nroff not available
mandoc users do not need to install nroff to be able to format and view
manual pages. If both nroff and mandoc cannot be found it will show an
error.
2019-01-08 18:25:28 +01:00
Sean Molenaar
41b3331175 Add support for wayland copy/paste 2019-01-02 16:46:04 +01:00
David Adam
9e4ece8d89 CHANGELOG: next-minor updates, up to 05222a055a
[ci skip]
2018-12-28 22:18:35 +08:00
David Adam
0c25d7a49c CHANGELOG: 3.0.0 updates 2018-12-28 20:56:17 +08:00
David Adam
355cb88e38 Bump version for 3.0b1 2018-12-11 22:04:20 +08:00
David Adam
566aa6e78f CHANGELOG: final edits to 3.0b1
Up to 99d56ea2f9
2018-12-11 21:37:12 +08:00
David Adam
f022b4b721 CHANGELOG: further updates toward 3.0b1
Up to eb0539af60.
2018-12-09 21:37:19 +08:00
David Adam
d40a07436a CHANGELOG: further updates toward 3.0b1 2018-12-06 22:41:22 +08:00
Fabian Homborg
edf95478d9 CHANGELOG: Remove $cmd_duration change
We reverted this again.

[ci skip]
2018-11-30 19:08:29 +01:00
David Adam
19be5f31b8 CHANGELOG: improve some verbiage
[ci skip]
2018-11-24 22:08:10 +08:00
Mahmoud Al-Qudsi
31d17f4559 Rename string escape --style=pcre2 to string escape --style=regex 2018-11-16 20:22:06 -06:00
Mahmoud Al-Qudsi
680040d17d Document new PCRE2 string escaping in CHANGELOG and string.txt 2018-11-15 12:00:56 -06:00
Mahmoud Al-Qudsi
f56c317bd0 Add note about literal 0 indices to changelog
[ci skip]
2018-11-14 23:35:03 -06:00
David Adam
eed274ff78 CHANGELOG: editing for upcoming 3.0
[ci skip]
2018-11-13 22:54:59 +08:00
Mahmoud Al-Qudsi
34440165aa Add completions for openocd 2018-11-07 20:08:16 -06:00
Aaron Gyes
db1500bfa4
Update CHANGELOG.md
Mention that dim/italics were made to work on macOS (ancient ncurses).
2018-11-06 14:09:26 -08:00
David Sanson
7926b69d15 Add completions for pandoc
Taken from https://github.com/dsanson/fish-completion-pandoc under the
GNU GPL as at 7195da6fc4bcbdd49ea63d47c27e4bfec2135660.

Closes #2937.
2018-11-04 21:22:58 +08:00
ridiculousfish
47890389e1 Merge branch 'uvar_path_support'
Support for --path and --unpath in universal variables.
Closes  #5271
2018-10-27 01:24:27 -07:00
ridiculousfish
9690ac5974 Rename fish_universal_variables file to fish_variables
This is to avoid development versions of fish 3.0 freaking out when the
file format is changed. We now have better support for for future universal
variable formats so it's unlikely we'll have to change the file name again.
2018-10-26 16:06:50 -07:00
Mahmoud Al-Qudsi
5ad292328a Add dynamic clang completions via clang --autocomplete
Use clang/clang++'s own autocompletion support to complete arguments. It
is rather convoluted as clang generates autocompletions for a portion of
the current token rather than the entire token, e.g. while `--st` will
autocomplete to `--std=` (which is fine by fish), `--std=g` will
autocomplete to `gnu...` without the leading `--std=` which breaks fish'
support for the completion.

Additionally, on systems where clang/clang++ is the system compiler
(such as FreeBSD), it is very often for users to invoke a newer version
of clang/clang++ installed as clang[++]-NN instead of clang. Using a
monkey-patched version of `complete -p` to support that without breaking
(future) completions for commands like `clang-format`.

Closes #4174.
2018-10-24 23:14:55 -05:00
Mahmoud Al-Qudsi
f695284a84 Add fish private mode info to changelog and manual 2018-10-24 19:33:48 +02:00
Fabian Homborg
1d5e715008 source: Return error instead of implicitly reading from tty
For things like

    source $undefined

or
    source (nooutput)

it was quite annoying that it read from tty.

Instead we now require a "-" as the filename to read from the tty.

This does not apply to reading from stdin if it's redirected, so

    something | source

still works.

Fixes #2633.
2018-10-22 21:22:27 +02:00
ridiculousfish
3f3b3a7006 Export arrays as colon delimited, and support path-style variables
This commit begins to bake in a notion of path-style variables.

Prior to this fix, fish would export arrays as ASCII record separator
delimited, except for a whitelist (PATH, CDPATH, MANPATH). This is
surprising and awkward for other programs to deal with, and there's no way
to get similar behavior for other variables like GOPATH or LD_LIBRARY_PATH.

This commit does the following:

1. Exports all arrays as colon delimited strings, instead of RS.

2. Introduces a notion of "path variable." A path variable will be
"colon-delimited" which means it gets colon-separated in quoted expansion,
and automatically splits on colons. In this commit we only do the exporting
part.

Colons are not escaped in exporting; this is deliberate to support uses
like

    `set -x PYTHONPATH "/foo:/bar"`

which ought to work (and already do, we don't want  to make a compat break
here).
2018-10-19 17:29:39 -07:00