Commit Graph

9953 Commits

Author SHA1 Message Date
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
ridiculousfish
f4351eb0f3 Relnote fix for #5449 in 3.0.1 2019-01-20 13:55:18 -08:00
ridiculousfish
1ce9721590 exec to only warn on background jobs in interactive sessions
Extension of fix for #5449 in b007248
2019-01-20 13:53:37 -08:00
Fabian Homborg
60ced5dbc7 Only warn on exec for background jobs
If it's a foreground job, it is related to the currently running exec.

This fixes exec in functions, i.e.

    function reload
        exec fish
    end

would previously always ask about the "function reload" job.

Fixes #5449.

Fixes oh-my-fish/oh-my-fish#664.
2019-01-20 13:53:33 -08:00
ridiculousfish
2a190c6f3b exec to only warn on background jobs in interactive sessions
Extension of fix for #5449 in b007248
2019-01-20 13:53:11 -08:00
Fabian Homborg
c66b3128ec Use wcstod_l on NetBSD
It has wcstod_l, but not uselocale, so we can't use the fallback.
2019-01-20 18:35:38 +01:00
Mahmoud Al-Qudsi
f90cb3957f Add missing define for HAVE_WCSTOD_L to osx/config.h
I believe this should take care of the reported problem with the
corrected definition for `wcstod_l`. For future reference, any changes
to `config.h.in` should also be reflected in `osx/config.h`
2019-01-20 16:40:50 +08:00
ridiculousfish
b1f5cb9bf4 Revert "Revert "Fix unsafe locale usage in wcstod_l fallback""
This reverts commit c15a702f18.

The tests are no longer broken after rerunning CMake.
2019-01-19 13:27:28 -08:00
Fabian Homborg
3847d2e9d1 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-18 19:27:41 +01:00
Aaron Raimist
1398ee9bbb docs: list full command to change default shell 2019-01-18 10:38:12 +01:00
Dan Zimmerman
857561ca14 Fix warnings when compiling on macos
These warnings were appearing and annoying me so Im making a PR to fix
them.
2019-01-17 13:56:17 -06:00
Fabian Homborg
34ed958f72 Test that things can't wrap themselves
This is a test belonging to the previous commit, 58b696bed.

See #5541.
2019-01-17 16:46:15 +01:00
Sam Yu
02c32c638f Fix completion of directories for configure 2019-01-17 10:13:27 +01:00
Fabian Homborg
58b696bed1 complete: Don't allow wrapping a command with itself
Double-fixes #5541, by not allowing it to happen.
2019-01-17 09:49:50 +01:00
Fabian Homborg
84339d5636 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-17 09:46:55 +01:00
Mahmoud Al-Qudsi
1b23814f8b Clarify the point of type --force-path [docs]
[ci skip]
2019-01-16 17:42:11 -06:00
Mahmoud Al-Qudsi
dd31933c09 Remove spurious initialization in profiling_cmd_name_for_redirectable_block 2019-01-16 15:48:25 -06:00
Mahmoud Al-Qudsi
20cdcfadac Remove write-only assignments from autload.cpp 2019-01-16 15:46:11 -06:00
Mahmoud Al-Qudsi
53355885c8 Clean up dead code in builtin_read.cpp 2019-01-16 15:44:10 -06:00
Mahmoud Al-Qudsi
333bf1fd9f Remove write-only desc_width local variable 2019-01-16 15:38:27 -06:00
Mahmoud Al-Qudsi
bad3c5d79d Remove dead assignment and clarify ENV_NOT_FOUND behavior for set -e 2019-01-16 15:27:23 -06:00
Aaron Gyes
fb74ccb1f2 set's color completions: remove Color description.
On `set fish_color_cwd <TAB>`, a bunch of named colors are
shown in the pager. Each and every one has a description of "Color".

These are all very obviously colors, and none are not colors,
the description does not tell us anything specific about the item.

Descriptions in situations like this are actually a hinderance
because of the way they cause less to fit into the pager. Remove it
2019-01-16 10:34:16 -08:00