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
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.
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.
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.
Emitting warnings about EPIPE errors when writing to stdout or stderr is
more annoying than helpful. So suppress that specific warning message.
Fixes#2516
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
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
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
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.
* 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
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.
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.
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.
* 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/*.
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