Commit Graph

444 Commits

Author SHA1 Message Date
Fabian Homborg
9f61512e67 CHANGELOG prompt improvements
[ci skip]
2019-12-30 14:07:10 +01:00
239
d23ea5f455 Added completions for Keybase commands 2019-12-12 14:16:21 +01:00
Fabian Homborg
ff4498ceec CHANGELOG: Add some nice bits
[ci skip]
2019-12-11 20:50:23 +01:00
Shun Sakai
9510d317c1 CHANGELOG: add lz4 and zstd completions 2019-12-07 12:21:51 +01:00
ridiculousfish
d11a5088c5 Relnote vi replace mode #6342 2019-11-25 16:42:18 -08:00
Johannes Altmanninger
7d5b44e828 Support FOO=bar syntax for passing variables to individual commands
This adds initial support for statements with prefixed variable assignments.
Statments like this are supported:

a=1 b=$a echo $b        # outputs 1

Just like in other shells, the left-hand side of each assignment must
be a valid variable identifier (no quoting/escaping).  Array indexing
(PATH[1]=/bin ls $PATH) is *not* yet supported, but can be added fairly
easily.

The right hand side may be any valid string token, like a command
substitution, or a brace expansion.

Since `a=* foo` is equivalent to `begin set -lx a *; foo; end`,
the assignment, like `set`, uses nullglob behavior, e.g. below command
can safely be used to check if a directory is empty.

x=/nothing/{,.}* test (count $x) -eq 0

Generic file completion is done after the equal sign, so for example
pressing tab after something like `HOME=/` completes files in the
root directory
Subcommand completion works, so something like
`GIT_DIR=repo.git and command git ` correctly calls git completions
(but the git completion does not use the variable as of now).

The variable assignment is highlighted like an argument.

Closes #6048
2019-11-25 09:20:51 +01:00
Z. Grace Moreau
012a3137df update CHANGELOG 2019-11-10 22:19:15 +01:00
David Adam
e1e82ecd40 CHANGELOG: work towards 3.1.0
Up-to-date to eac9ec90.

[ci skip]
2019-11-05 21:50:05 +08:00
Johannes Altmanninger
6fb7f9b6b8 Fix completion for builtins (with subcommands)
Presently the completion engine ignores builtins that are part of the
fish syntax. This can be a problem when completing a string that was
based on the output of `commandline -p`.  This changes completions to
treat these builtins like any other command.

This also disables generic (filename) completion inside comments and
after strings that do not tokenize.

Additionally, comments are stripped off the output of `commandline -p`.

Fixes #5415
Fixes #2705
2019-11-04 16:44:51 +01:00
David Adam
5f99ec7eae Merge branch 'changelog' of git://github.com/faho/fish-shell into faho-changelog 2019-11-04 22:53:40 +08:00
ridiculousfish
a7f1d2c0c7 Add support for fish_trace variable to trace execution
This adds support for `fish_trace`, a new variable intended to serve the
same purpose as `set -x` as in bash. Setting this variable to anything
non-empty causes execution to be traced. In the future we may give more
specific meaning to the value of the variable.

The user's prompt is not traced unless you run it explicitly. Events are
also not traced because it is noisy; however autoloading is.

Fixes #3427
2019-11-02 14:40:57 -07:00
Fabian Homborg
ab011b0c28 Overhaul CHANGELOG
This reorders many CHANGELOG entries.
The main idea is to keep the "NOTABLE fixes and improvements" for the headline items,
so a bunch of entries (like "Empty uvars can now be exported") are moved to more specific sections.

Other than that, there's some rewording, and the new feature flag is mentioned in Deprecations,
because that's effectively what it is.

[ci skip]
2019-10-31 20:08:32 +01:00
Amy Grace
ba56a2ec0e Add completions for irb (#6260) 2019-10-29 19:11:25 +01:00
LawAbidingCactus
21a6a192ae refactor gpg.fish completions
refactor gpg completions into functions
comment changes; improve gpg version detection

[ci skip]
2019-10-29 19:07:35 +01:00
ridiculousfish
2a92e66902 Support for &> and &| as convenience redirections
This adds support for &> and &| syntax, which both redirect stdout, and
also apply a redirection of stderr to stdout.
2019-10-27 15:24:57 -07:00
Akatsuki
0ef6a136e8 completions: add btrfs (#6243)
* completions: add btrfs
Completion definitions for the btrfs-progs.

* completes/btrfs.fish: using `not set -q argv[1]` instead of `test -z $argv`

* CHANGELOG: add btrfs completions
2019-10-26 18:15:42 +02:00
Z. Grace Moreau
b6fbec8107 update CHANGELOG 2019-10-26 18:13:15 +02:00
239
6a9ab0599f completion: zpaq archiver (#6245) 2019-10-25 15:22:09 +02:00
David Adam
4fbc6cd3f8 CHANGELOG: minor work on 3.1.0 2019-10-24 17:13:50 +08:00
Johannes Altmanninger
44c311b5df Update changelog 2019-10-24 11:06:19 +02:00
Z. Grace Moreau
8c9f3c7bd4 update CHANGELOG 2019-10-23 19:41:53 +02:00
Johannes Altmanninger
b7f35f949e Do not import vars that are equivalent to a universal exported var
Universal exported variables (created by `set -xU`) used to show up
both as universal and global variable in child instances of fish.

As a result, when changing an exported universal variable, the
new value would only be visible after a new login (or deleting the
variable from global scope in each fish instance).

Additionally, something like `set -xU EDITOR vim -g` would be imported
into the global scope as a single word resulting in failures to
execute $EDITOR in fish.

We cannot simply give precedence to universal variables, because
another process might have exported the same variable.  Instead, we
only skip importing a variable when it is equivalent to an exported
universal variable with the same name.  We compare their values after
joining with spaces, hence skipping those imports does not change the
environment fish passes to its children. Only the representation in
fish is changed from `"vim -g"` to `vim -g`.

Closes #5258.
This eliminates the issue #5348 for universal variables.
2019-10-19 12:41:57 +02:00
Johannes Altmanninger
5e274066e3 Always return absolute path in path_get_cdpath
Fixes #6220
2019-10-19 12:38:17 +02:00
Johannes Altmanninger
2fed311d4c builtin commandline: fix flags -p and -j not splitting on && and ||
Fixes #6214
2019-10-18 09:36:52 +02:00
Z. Grace Moreau
4c63ae357a update CHANGELOG 2019-10-15 13:05:08 -07:00
Johannes Altmanninger
9b86d5dd16 Export all local exported variables in a new scope
Fixes #6153
2019-10-06 12:10:21 -07:00
Fabian Homborg
eca1fcad90 CHANGELOG: Document the new binding changes
[ci skip]
2019-10-06 15:38:11 +02:00
Fabian Homborg
8bc44b2bff CHANGELOG: Introduce sub-headers for interactive improvements
These are just too many and too different to keep them under one heading.
2019-10-06 15:31:58 +02:00
David Adam
75bd821495 CHANGELOG: minor work on 3.1.0 2019-10-04 07:11:04 +08:00
David Adam
3ca4dbb2b9 CHANGELOG: work on 3.1.0
[ci skip]
2019-09-26 22:59:02 +08:00
David Adam
10f38c6865 CHANGELOG: work on 3.1.0
[ci skip]
2019-09-23 23:29:43 +08:00
ridiculousfish
6bbf3726fc Relnote expand-abbr and self-insert changes 2019-09-21 16:06:19 -07:00
ridiculousfish
d903fe6073 Relnote fix for #3189 2019-09-14 16:42:28 -07:00
David Adam
77ef2ef6c3 jobs: return success when a job is found via --last
Closes #6104.
2019-09-14 13:01:36 -05:00
LawAbidingCactus
35b64b0470 add completions for qubes-gpg-client 2019-08-27 15:20:07 +08:00
ridiculousfish
124def8f4b Un-changelog the history fix
Turns out the bug never actually shipped in a release; it bisected to
3ae5b23971
2019-08-15 19:59:35 -07:00
ridiculousfish
a87e0183df Stop rewriting the history file on every command
fish is designed to append to the history file in most cases. However
save_internal_via_appending was never returning success, so we were
always doing the slow rewrite path. Correctly return success.

Fixes #6042
2019-08-15 13:49:17 -07:00
Aaron Gyes
47798510bd tests, CHANGELOG: regex-easyesc
Oops, missed these the first time around.
2019-08-13 22:56:31 -07:00
LawAbidingCactus
1693b53221 document changes in CHANGELOG.md 2019-08-08 18:49:26 +02:00
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
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