Commit Graph

6558 Commits

Author SHA1 Message Date
Kurtis Rader
e9de674bbd handle ttyname returning NULL
If the tty has been closed (i.e., become invalid) the `ttyname()`
function will return NULL. Passing that NULL to `strstr()` can crash
fish which means it won't kill its child processes and exit cleanly.

Another fix for #3644
2017-01-10 13:11:39 -08:00
Clément Martinez
4bed9ea56d Add xz support to __fish_complete_tar function 2017-01-10 16:09:49 +01:00
Clément Martinez
c28bd74ca7 Add --xz, -J completion options to tar command 2017-01-10 16:09:49 +01:00
David Adam
bf274f4fb5 CHANGELOG: updates for 2.5b1
[ci skip]
2017-01-10 07:20:53 +08:00
Kurtis Rader
f365f720da don't warn about using obsolete complete options
Fixes #3640
2017-01-09 11:21:34 -08:00
Kurtis Rader
4223b3da68 deal with BC_LINE_LENGTH not being honored
FreeBSD 12, Dragonfly BSD, and presumably other BSDs don't recognize the
BC_LINE_LENGTH env var and might split the output at 70 chars.

Fixes #3414
2017-01-09 17:32:11 +08:00
ridiculousfish
e5bfdb99b6 Enable mkostemp to be weak-linked
mkostemp is not available on some older versions of macOS. In order
for our built binaries to run on them, mkostemp must be weak-linked.
On other systems, we use the autoconf check.

Introduce a function fish_mkstemp_cloexec which uses mkostemp if
it was detected and is available at runtime, else falls back to
mkstemp. This isolates some logic that is currently duplicated in
two places.

See #3138 for more on weak linking.
2017-01-08 22:18:27 -08:00
ridiculousfish
6eb88dc13f Redeclare certain wcs functions as weak on macOS
In order to use C++11 with the standard macOS Xcode toolset,
we must use libc++. This in turn requires using 10.7 as our
MIN_REQUIRED in the availability macros, which in turn marks
certain wide-character functions as strong symbols (since they
were introduced in 10.7).

Redeclare them as weak, so that we can run on 10.6 without link
errors. See #3138 for more.
2017-01-08 22:18:27 -08:00
Fabian Homborg
48392517d4 Moar CHANGELOG for 2.5b1 2017-01-08 16:51:40 +01:00
Fabian Homborg
c5a6d87c5e Add while-read example to read docs 2017-01-07 14:31:05 +01:00
Fabian Homborg
e1b445f934 Document read return status
Fixes #3711.
2017-01-07 14:22:15 +01:00
m4sk1n
19c038d1ef Polish translation (#3710)
61% completed
2017-01-07 14:06:38 +01:00
Fabian Homborg
6daa8d7e12 Replace puts() with wprintf() 2017-01-07 14:05:42 +01:00
Fabian Homborg
177e06808c Replace all printf invocations with wprintf
Remember, GNU doesn't allow mixing narrow and wide IO.
2017-01-07 14:05:42 +01:00
Fabian Homborg
69005f8c60 builtin_test: Produce wide output to stderr
GNU systems don't allow mixing narrow and wide IO, so some of these
messages were lost since 1621fa43d8.

stderr is also the more logical place for error output to end up.

Fixes #3704.
2017-01-07 14:05:42 +01:00
David Adam
fcd53af89d debian packaging: bump version to debhelper compat level 9 2017-01-07 17:53:59 +08:00
David Adam
6c3f12fe24 debian packaging: drop support for Debian 7
Debian 7 (wheezy) is EoL and producing working binaries that are easily
installable has proven impossible.
2017-01-07 16:58:36 +08:00
Kurtis Rader
6f8775499f don't warn about EPIPE errors
Emitting warnings about EPIPE errors when writing to stdout or stderr is
more annoying than helpful. So suppress that specific warning message.

Fixes #2516
2017-01-06 23:59:06 -08:00
David Adam
430d82bd4f debian packaging: drop support for Ubuntu 12.04
Ubuntu 12.04 is EoL in three months' time and producing working binaries
that are easily installable has proven impossible.
2017-01-07 15:33:16 +08:00
Kurtis Rader
573916e5e2 ensure CMD_DURATION can be used in prompts
A third-party plugin noticed that using `$CMD_DURATION` in the prompt
causes problems when combined with the recent changes to tighten up
parsing of strings meant to be integer values. This fixes the problem by
ensuring the var is defined before the first interactive command is run.

See https://github.com/fisherman/dartfish/issues/7
2017-01-06 21:14:29 -08:00
Kurtis Rader
7a3e0924e0 only warn about obsolete complete flags once
It was pointed out that the previous change to alert people to the fact
their completion scripts were using flags that are no longer valid
resulted in way too many warnings. This limits the warning to one per
session.

Fixes #3640
2017-01-06 21:03:16 -08:00
Fabian Homborg
fc81fa6abf Start 2.5b1 CHANGELOG 2017-01-06 17:41:03 +01:00
Fabian Homborg
af022728bd Document complete-and-search moving backwards in pager
This isn't _clean_, but making a real binding that moves backwards if
in pager and does something else if not is more work.

Fixes #3703.
2017-01-06 16:13:01 +01:00
Fabian Homborg
5ca63c4956 dirs: Stringify
Two useless forks plus one per element in $dirstack.
2017-01-06 16:13:01 +01:00
Fabian Homborg
a070dffc4e Merge pull request #3666 from drwilly/master
mixed bag of shell scripting improvements
2017-01-06 16:10:03 +01:00
Kurtis Rader
f0515d0caa improve wording of error message
Zanchey proposed this improved wording in feedback to PR #3658.
2017-01-05 12:09:29 -08:00
Fabian Homborg
1f836f72b3 pushd: Use $PWD instead of command pwd
Useless forks.
2017-01-05 01:49:44 +01:00
dareg
89e48ba0b3 Add completion for the changelog subcommand 2017-01-03 20:59:18 -08:00
Kurtis Rader
b118ed69d3 convert narrow stderr output to wide forms
On some platforms, notably GNU libc, you cannot mix narrow and wide
stdio functions on a stream like stdout or stderr. Doing so will drop
the output of one or the other. This change makes all output to the
stderr stream consistently use the wide forms.

This change also converts some fprintf(stderr,...) calls to debug()
calls where appropriate.

Fixes #3692
2017-01-03 16:14:42 -08:00
Oliver Gondža
dddbdddcff Avoid using empty description for complete in maven completion 2017-01-03 16:57:12 +01:00
Kurtis Rader
05f19ad09c clarify autoloading and aliases
Another dev pointed out my previous attempt to resolve issue #3612 did
not do a good job of clarifying the matter. Hopefully this change is
better at explaining why autoloading is not applicable to aliases.
2017-01-02 17:15:18 -08:00
Kurtis Rader
7211802fc0 silence unused parmeter warning 2017-01-01 21:48:40 -08:00
Dale Eidd
7b906134e2 Fix commandline selection including extra character
Fixes #3684
2017-01-01 13:57:31 -08:00
Aaron Gyes
1fb92b6f8c Use new set_color features for __fish_cancel_commandline
We still apparently need to rely on tput for 'el'.
2016-12-31 06:12:05 -08:00
Anders Rasmussen
b22842a52f Add italics, dim, reverse video to set_color (#3650)
* Add italics and dim modifier to set_color

* update documentation for set_color

* add reverse mode to set_color

* Use standout mode as fallback for reverse mode

* Apply patch from @Darkshadow2 adding additional modes
2016-12-30 11:33:25 -08:00
Vedant Nevetia
834fdf8666 Fix job_t variable name inconsistency (#3685) 2016-12-29 16:09:52 -08:00
Kurtis Rader
1621fa43d8 don't mix narrow and wide stdio
Fixes #3686
2016-12-29 12:24:56 -08:00
Fabian Homborg
3da3558e35 Remove eval in __fish_complete_proc
This was completely useless.
2016-12-29 15:35:19 +01:00
Fabian Homborg
b29b026106 math: Set BC_LINE_LENGTH to a very high number
This means we no longer have to do manual stitching which improves performance.
2016-12-29 15:13:48 +01:00
Fabian Homborg
7ffcb828fe Add test for long numbers in math
This should catch the error in 26e781ef5a.
2016-12-29 14:00:15 +01:00
Fabian Homborg
11f4e64e45 Revert "Use BC_LINE_LENGTH=2 for bc."
This would fail on very long numbers, e.g.

`math "1 + 1233242342353453463458972349873489273984873289472914712894791824712941"`

would now return "42", where it previously returned the correct "1233242342353453463458972349873489273984873289472914712894791824712942".

This reverts commit 26e781ef5a.
2016-12-29 13:53:11 +01:00
Fabian Homborg
bd93a9e6ff Remove useless-use-of-echo in git_prompt 2016-12-29 13:49:21 +01:00
Aaron Gyes
aed5267fd1 Stringify __fish_git_prompt 2016-12-29 04:11:23 -08:00
Aaron Gyes
26e781ef5a Use BC_LINE_LENGTH=2 for bc.
It's not the case that macOS and old BC doesn't respect this environment
variable, just that they don't have special behavior when it's set to 0.
However, there is rather universal favorable behavior with a value of 2.

Output is of the form:
\
999999999999999999999999999999999...

with the second line being arbitrarily long. So just grab that line
instead of stitching with `string`.

This can yield a 25-30% speedup.
2016-12-29 03:47:37 -08:00
Kurtis Rader
ee6691458e clarify that aliases are not autoloaded
Fixes #3612
2016-12-28 19:44:25 -08:00
Samantha Marshall
4cd34816cf Adding subcommand completions for launchctl 2016-12-28 18:39:25 +01:00
Radomír Bosák
f9835b5077 Add support for subcommands in __fish_man_page
This commit adds a feature that after typing "git add" and pressing
"alt+h", the manpage for "git-add" instead of "git" would be displayed.

The new logic takes the first argument which doesn't start with a dash
and tries to display manpage for "command-argument"; it falls back to
"man command" it the first try doesn't succeed.

Fixes #3618.
2016-12-27 16:03:21 -08:00
Zoltán Mizsei
52c7ebe502 Haiku needs _BSD_SOURCE and <bsd/ifaddrs.h> 2016-12-27 16:00:13 -08:00
Sam H
6b536922af Append paths from /etc/manpaths and /etc/manpaths.d/* to MANPATH, for #1092.
* Only append paths if `MANPATH` is already set, to match behavior of macOS
     `path_helper` utility.
   * Use the same technique as is used above to set PATH from /etc/paths and
     /etc/paths.d/*.
2016-12-27 14:21:36 -08:00
Kurtis Rader
574424dc5a fix uvar tests
I noticed that universal variable tests were failing on Cygwin and
Dragonfly BSD. The failures were because we are attempting to verify the
correct behavior of mechanisms that are known to be broken on those
platforms. There are still uvar test failures on those platforms with
this change but they are due to actual problems rather than bugs in the
tests.

Fixes #3587
2016-12-25 21:17:27 -08:00