Commit graph

9624 commits

Author SHA1 Message Date
Fabian Homborg
72423c517a webconfig: Fix binding tab
This broke when --preset was introduced.

We allow a "--preset" or "--user" to appear right after the "bind",
and save the value, but don't use it yet.

Fixes #5534.

[ci skip]
2019-01-22 14:55:37 -08:00
ridiculousfish
88ee55443c Update docs on tab completions and searching
Fixes #5547
2019-01-22 14:44:09 -08: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
71b5591f21 Update docs on tab completions and searching
Fixes #5547
2019-01-22 14:41:16 -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
ridiculousfish
dfa61926e8 Correctly inherit a virtual PWD
PWD is not set in fish vars because it is read only.
Use getenv() to fetch it, allowing fish to inherit a virtual PWD.

This cherry pick includes both:
24f251e04 Correctly remove the test directory again in cd test
91a9c9897 Correctly inherit a virtual PWD

Fixes #5525
2019-01-22 14:10:50 -08:00
ridiculousfish
24f251e044 Correctly remove the test directory again in cd test 2019-01-22 14:07:25 -08:00
Fabian Homborg
d88be7b5c8 tests/cd: cd back before cleaning up
Otherwise this'd run afoul of OpenIndiana's "no removing $PWD" rule. Spoilsports!

See #5472.
2019-01-22 14:04:27 -08:00
ridiculousfish
91a9c98974 Correctly inherit a virtual PWD
PWD is not set in fish vars because it is read only.
Use getenv() to fetch it, allowing fish to inherit a virtual PWD.

Fixes #5525
2019-01-22 13:34:04 -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
1b551e553b Fix regression for #4178 and others introduced by 364c839
...while still keeping intact the fix for #5519.
2019-01-22 12:39:37 -06:00
Fabian Homborg
963e3217e5 env_get_runtime_path: Check for getpwuid() failure
Otherwise this is a NULL dereference and then crash.

Fixes #5550.
2019-01-22 19:33:22 +01:00
Fabian Homborg
82b4d7225c env_get_runtime_path: Check for getpwuid() failure
Otherwise this is a NULL dereference and then crash.

Fixes #5550.
2019-01-22 19:30:04 +01:00
Fabian Homborg
91ecd3b9b5 completions/git: Skip "!" shell-aliases for wrapping
We can't complete these, and now the user can do

```
set -g __fish_git_alias_$alias $command
```

e.g.

```
set -g __fish_git_alias_co checkout
```

if the arguments in the alias end up going to `git alias`.

Fixes #5412.

[ci skip]
2019-01-22 19:18:00 +01:00
Fabian Homborg
288cfa8fb2 completions/git: Also don't use files for porcelain=2
This was an oversight from the previous commit. Not that it matters
much, because we already removed $files.

Still, this would fail if someone defined a global $files, so let's fix it.

[ci skip]
2019-01-22 19:16:29 +01:00
Aaron Gyes
b23403ee6b Revert "__fish_complete_suffix: do not show description when not passed one"
This reverts commit 367661d4f1.

This was the wrong way to address this annoyance of mine.
2019-01-21 22:55:56 -08:00
Aaron Gyes
23e94d8349 improve GNU patch completions
shorter descriptions that can fit in a terminal window, and option arguments added.

hide one option that is only functional on Cygwin unless we are on Cygwin
2019-01-21 22:37:45 -08:00
Aaron Gyes
367661d4f1 __fish_complete_suffix: do not show description when not passed one
Make it so that the generated completion has the form \t\n
when the optional description has been ommitted - otherwise
the original option's description gets inherited and is seen hundreds
of times repeating in the pager.
2019-01-21 22:37:45 -08:00
Mahmoud Al-Qudsi
0edaf42d10 Fix regression for #4178 and others introduced by 364c839
...while still keeping intact the fix for #5519.
2019-01-21 20:29:31 -06:00
Fabian Homborg
171ae99295 Don't ASSERT_IS_NOT_FORKED_CHILD so much
This is hammered sooo much that it actually hurts performance.

    for i in (seq 100000); test 1 = 1; end

is about 40% (!) slower with it.
2019-01-21 18:21:00 -08:00
Fabian Homborg
96f7924661 Fix nim prompt (via web_config)
This had a helper function defined outside of the fish_prompt
function, so `funcsave` missed it (see #736).

Fixes #5490.

[ci skip]
2019-01-21 18:09:39 -08:00
Mahmoud Al-Qudsi
07e03dd794 Release notes for #5426 2019-01-21 20:08:38 -06:00
Mahmoud Al-Qudsi
462cb6044c Use standard __CYGWIN__ define for Cygwin detection 2019-01-21 20:06:16 -06:00
Mahmoud Al-Qudsi
ec77135cf2 Allow more flexibility with file completions for yarn
Closes #5502
2019-01-21 17:41:16 -08:00
Mahmoud Al-Qudsi
d5d80c0742 Fix extra space in fish_title
Closes #5517. Credit goes to @jadenPete.

[skip-ci]
2019-01-21 17:27:35 -08:00
Fabian Homborg
97f0cc9662 Don't wrap functions with themselves
Our weird %-expanding function wrappers around kill et all defined
"--wraps" for the same name.

As it turns out, fish follows that one, and executes the completion
multiple times.

I didn't notice because these tend to be rather quick on linux, but on
macOS that's apparently a real issue.

Fixes #5541.

[ci skip]
2019-01-21 17:24:49 -08:00
Sam Yu
afb9094b4c Fix completion of directories for configure 2019-01-21 17:21:28 -08:00
Fabian Homborg
f2a1130afd Also set the read-only flag for non-electric vars
For some reason, we have two places where a variable can be read-only:

- By key in env.cpp:is_read_only(), which is checked via set*

- By flag on the actual env_var_t, which is checked e.g. in
  parse_execution

The latter didn't happen for non-electric variables like hostname,
because they used the default constructor, because they were
constructed via operator[] (or some such C++-iness).

This caused for-loops to crash on an assert if they used a
non-electric read-only var like $hostname or $SHLVL.

Instead, we explicitly set the flag.

We might want to remove one of the two read-only checks, or something?

Fixes #5548.
2019-01-21 17:14:01 -08:00
Aaron Gyes
3115446a07 string completions: add missing upper, lower, split0, join0, unescape
and --style=regex
2019-01-21 17:08:49 -08:00
Aaron Gyes
8743961301 Fix fish_config rendering brights as normal on prompt previews
I noticed our default brgreen for fish_color_user was rendering
as just unstyled white.
2019-01-21 13:59:36 -08:00
Aaron Gyes
a5e5f90f73 ls.fish: fix colorless ls not taking options
That -- no-op would have the effect that a user can not pass more
options to ls, they would be interpreted as file names.
2019-01-21 07:52:26 -08:00
Aaron Gyes
488e208cca ls.fish: also show indicators on non-GNU ls, refactor
GNU ls's --indicator-style=classify is the same as POSIX -F.

Refactor and change command testing logic so that we define the
function in the same place for all platforms, and use -F on all
the platforms when stdout is a TTY.
2019-01-21 06:56:57 -08:00
Aaron Gyes
5dc0ff0a90 ls.fish: remove for loop
`command -s` can take multiple arguments to try.
2019-01-21 03:15:43 -08:00
Fabian Homborg
cb09f9aef2 Switch to readdir from readdir_r
It's deprecated in glibc, and does not work properly on Solaris.

Fixes #5458.
2019-01-21 12:02:05 +01:00
David Adam
749347ff4c debian packaging: recommend python3 or python2
Closes #5492.

(cherry picked from commit 1f897d2c43)
2019-01-21 17:57:38 +11:00
Fabian Homborg
7a163e8e98 completions/git: Stop limiting to the token
This enables fuzzy-matching outside of the current directory again.

As it turns out, the performance impact here isn't as large as I
thought - it's massively dependent on caching.

Fixes #5476.

(cherry picked from commit 73bae383e0)
2019-01-21 17:51:50 +11:00
Fabian Homborg
3855608c69 docs: Document $hostname
Fixes #5469.

[ci skip]

(cherry picked from commit 72c0213d42)
2019-01-21 17:50:17 +11:00
Fabian Homborg
8ff8124765 cmake: Add missing HAVE_WCSTOD_L #cmakedefine
Turns out we've been using the fallback everywhere.

See #5453.

(cherry picked from commit 7078aa4642)
2019-01-21 17:49:02 +11: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
Fabian Homborg
40f5dd200b share/config: Don't split /etc/paths entries on spaces
This used `read -la`, which _splits_.

Instead, don't do that, each line is its own entry.

Fixes #5481.

[ci skip]
2019-01-20 18:02:35 -08:00
Fabian Homborg
059804612a string: Fix crash with _GLIBCXX_ASSERTIONS
This asserted because we accessed wcstring::front() when it was empty.

Instead, check explicitly for it being empty before.

Fixes #5479
2019-01-20 17:46:49 -08:00
ridiculousfish
028bff7b44 Relnote fix for #5519 2019-01-20 17:46:19 -08:00
ridiculousfish
364c839279 Unconditionally set the tty mode in reader_readline
There was a bogus check for is_interactive_session. But if we are in
reader_readline we are necessarily interactive (even if we are not in
an interactive session, i.e. a fish script invoked some interactive
functionality).

Remove this check.

Fixes #5519
2019-01-20 17:40:03 -08:00
ridiculousfish
3cc581fbb0 Unconditionally set the tty mode in reader_readline
There was a bogus check for is_interactive_session. But if we are in
reader_readline we are necessarily interactive (even if we are not in
an interactive session, i.e. a fish script invoked some interactive
functionality).

Remove this check.

Fixes #5519
2019-01-20 17:36:31 -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
fec10830d3 Correctly handle exited jobs in process_mark_finished_children
This is effectively a pick of 2ebdcf82ee
and the subsequent fixup. However we also avoid setting WNOHANG unless
waitpid() indicates a process was reaped.

Fixes #5438
2019-01-20 15:07:08 -08:00
ridiculousfish
e2f2dbf032 Correctly handle exited jobs in process_mark_finished_children
This is effectively a pick of 2ebdcf82ee
and the subsequent fixup. However we also avoid setting WNOHANG unless
waitpid() indicates a process was reaped.

Fixes #5438
2019-01-20 15:04:27 -08:00
ridiculousfish
e490372fbf Relnote fix for #5449 2019-01-20 13:56:42 -08:00