Took care of remaining issues preventing fish from building on Solaris.
Mainly caused by some assumptions that certain defines are POSIX when
they are not (`NAME_MAX`).
Moved `NAME_MAX` defines to common.h - for some reason, it was being
defined in a cpp file (`env_universal_common.cpp`) even though it is used
in multiple source files.
Now compiles on Solaris 11 with GNU Make. Still some warnings because
fish was written with GNU getopt in mind and the Solaris version doesn't
use `const char *` but rather just `char *` for getopt values, but it
builds nevertheless.
Assuming this closes#3340
We had pid_status defined as a pid_t instance, which was fine since on
most platforms pid_t is an alias for int. However, that is not
universally the case and waitpid takes an int *, not a pid_t *.
Smarter BSDmakefile that automatically calls gmake to build the targets,
even including `-j` if provided. README.md can be simplified to remove
`gmake` references from build instructions for BSD users.
A completion may have zero length; in this case the length of the
prefix was omitted and the completion was not visible. Correct the
calculation to account for zero-width completions.
Fixes#4424
Drawing prompt in repo with text=auto attribute and mixed line endings in files was spawning crlf conversion warnings to terminal from unsilenced stderr of git diff
A recent discussion involving whether `can_be_encoded()` was broken
caused me to notice that we are inconsistent about whether Unicode code
points are specified using `\xXXXX` or `\uXXXX` notation. Which is
harmless but silly and potentially confusing.
j does not have any "logical" source of completions, but it almost often
called with arguments that have been seen before (since it is used to
jump to favorite/recent directories). We can search the history for
possible completions and use those.
This is an example of the behavior mentioned in #4344 as a possible
enhancement for fish 3.0, where completions can be provided from history
if none are otherwise found.
This flag was only documented for a few weeks before being renamed
`--show-time` and has been deprecated for a long time. Fish 3.0 is a good
opportunity to remove it.
Instead of treating the search term as a literal string to be matched
treat it as a glob. This allows the user to get a more useful set of
results by using the `*` glob character in the search term.
Partial fix for #3136
* Implement `history search --reverse`
It should be possible to have `history search` output ordered oldest to
newest like nearly every other shell including bash, ksh, zsh, and csh.
We can't make this the default because too many people expect the
current behavior. This simply makes it possible for people to define
their own abbreviations or functions that provide behavior they are
likely used to if they are transitioning to fish from another shell.
This also fixes a bug in the `history` function with respect to how it
handles the `-n` / `--max` flag.
Fixes#4354
* Fix comment for format_history_record()
On BSD platforms, a BSD-specific BSDmakefile is searched for and used
before any generic Makefile. We can use this to emit an informational
message directing the user to use GNU Make instead of relying on the
user's recognizing of random build failures on syntax errors as a sign
to switch to GNU Make.
(Random fact: this same trick also applies to GNU Make, which searches
for a GNUmakefile before using Makefile)
commit e07f1d59c06094846db8ce59f65d4790b222fffa
Author: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Date: Sun Sep 10 21:54:45 2017 -0500
Use git branch and git branch --remote for checkout completions
commit 9e1632236be065e051e306b11082ca4e9c7a0ee1
Author: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Date: Sun Sep 10 11:27:30 2017 -0500
Correct classification of remote and local branches
To prevent any breakage, no changes were made to __fish_git_branches,
instead its output was filtered into __fish_git_remote_branches and
__fish_git_local_branches, the two of which are now used to provide
completions for "git checkout ..."
Fixes#4395Closes#4396
It seems that under python3, s3cmd emits its output as a long list (like
ls -l) with or without the --long parameter to "s3cmd ls s3://...".
This patch includes only s3://* paths from that output as completions.
Addresses the main concern of #3830 by preserving the internal ordering
of tag/branch listings generated by git. Fixes mixing of remote and
local branches in completions.
Does not address the concern of having local branches on top, remote
branches after, and tags at the bottom - I don't believe we have that
functionality available to us yet. #361 only implemented sort within a
category of completions, but there is no category "weight" unless I'm
mistaken.
As discussed in #3805, this patch disables assigning fish to its own
process group at startup. This was trialled in #4349 alongside other
pgrp fixes which introduced additional problems, but this particular fix
seems to be OK.
Fixes#3805 and works around Microsoft/BashOnWindows#1653
* Hoist `for` loop control var to enclosing scope
It should be possible to reference the last value assigned to a `for`
loop control var when the loop terminates. This makes it easier to detect
if we broke out of the loop among other things. This change makes fish
`for` loops behave like most other shells.
Fixes#1935
* Remove redundant line