Commit graph

355 commits

Author SHA1 Message Date
Klaus Alexander Seistrup
28a17c4b05 Document that the : command now always exits successfully 2019-08-03 18:14:12 +02:00
Fabian Homborg
6500765256 Allow switch with something that expands to nothing
Meaning empty variables, command substitutions that don't print
anything.

A switch without an argument

```fish
switch
   case ...
end
```

is still a syntax error, and more than one argument is still a runtime
error.

The none-argument matches either an empty-string `case ''` or a
catch-all `case '*'`.

Fixes #5677.

Fixes #4943.
2019-07-31 14:08:28 +02:00
ridiculousfish
822b53c67a Don't color a whole string invalid because of an unclosed quote
When syntax highlighting a quoted string, if the string is not closed,
only show the opening quote as an error, not the whole string.
2019-07-24 12:43:47 -07:00
ridiculousfish
554ee240b3 Correct handling of explicitly separated output when all elements are empty
Previously when propagating explicitly separated output, we would early-out
if the buffer was empty, where empty meant contains no characters. However
it may contain one or more empty strings, in which case we should propagate
those strings.

Remove this footgun "empty" function and handle this properly.

Fixes #5987
2019-07-21 14:00:27 -07:00
ridiculousfish
e8c6de8055 Correctly export empty universal variables
Fixes #5992
2019-07-21 12:45:29 -07:00
ridiculousfish
d577eb4aaa Only use the global fish_complete_path and fish_function_path
Prior to this fix, fish would attempt to react if a local fish_complete_path
or fish_function_path were set. However this has never been very well tested
and will become impossible with concurrent execution. Always use the global
values.
2019-07-12 12:40:12 -07:00
Fabian Homborg
5133287873 CHANGELOG: List path_helper changes
Just replace the issue number because this is effectively a
replacement of the previous.

[ci skip]
2019-07-02 22:18:40 +02:00
Fabian Homborg
427a18c1ea fish_git_prompt: Add a way to use the informative chars
$__fish_git_prompt_use_informative_chars will use the informative
chars without requiring informative mode (which is really frickin'
slow!).

See #5726.

[ci skip]
2019-06-25 16:11:18 +02:00
Fabian Homborg
e921bd60c3 docs: Build index, tutorial and faq as man pages
This was clearly intended for index, but because it was called "fish"
it was overwritten by the "fish" command man page.

I also added the tutorial and faq. Both of those might not be *ideal*
as man pages (the tutorial makes references to colors that won't show
up), but it's better to provide them than not.

Hat-tip to @wwared

See #5521.

[ci skip]
2019-06-23 16:16:44 +02:00
Fabian Homborg
9b54a53758
Prevent not-yet-loaded functions from loaded when erased (#5951)
* Prevent not-yet-loaded functions from loaded when erased

Today, `functions --erase $function` does nothing if the function
hasn't been autoloaded yet.

E.g. run, in an interactive session

    > functions --erase ls
    > type ls

and be amazed that it still shows our default `ls --color=auto`
wrapper function.

This seems counter-intuitive - removing a function ought to remove it,
whether it had been executed before or not.

* doc/changelog
2019-06-22 11:08:36 +02:00
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