Commit Graph

7688 Commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
f18b6868b7 Include --quiet in command builtin summary 2017-10-04 12:02:52 +02:00
Mahmoud Al-Qudsi
11ede92d3f Include bind changes in Changelog for 3.0b1 2017-10-03 11:20:17 +02:00
Mahmoud Al-Qudsi
811beb9dcc Document new -s/--silent bind switch 2017-10-03 11:20:17 +02:00
Mahmoud Al-Qudsi
6e933f1c8f Add -s to builtin_bind's allowed parameter list 2017-10-03 11:20:17 +02:00
Mahmoud Al-Qudsi
46d1334f95 Silence bind errors in default key bindings
This silences binding errors due to keys not found in the current
termcap config in the default fish bindings.

Closes #4188, #4431, and obviates the original fix for #1155

It was necessary to re-implement builtin_bind as a class in order to
avoid passing around the options array from function to function and
as adding an opts parameter to `get_terminfo_sequence` would require
otps to be passed to all other builtin_bind_ functions so they could, in
turn, pass it to `get_terminfo_sequence`.
2017-10-03 11:20:17 +02:00
Mahmoud Al-Qudsi
cebb63c1b5 Merge pull request #4444 from trofi/master
Fix 'printf "%o"' handling on powerpc64
2017-10-03 09:58:23 +02:00
Sergei Trofimovich
53fd356850 fix 'printf "%o"' handling on powerpc64
On powerpc64 (big-endian platform) one test failed as:

  Testing file printf.in ... fail
  Output differs for file printf.in. Diff follows:
  --- printf.tmp.out      2017-10-02 18:14:17.740000000 -0700
  +++ printf.out  2017-10-02 18:11:59.370000000 -0700
  @@ -1,5 +1,5 @@
   Hello 1 2 3.000000 4.000000 5 6
  -a B 0 18446744073709551615
  +a B 10 18446744073709551615

It happens due to roughly the following code:
    swprintf(..., L"%o", (long long)8);
Here mismatch happens between "%o" (requires 32-bit value)
and 'long long' (requires 64-bit value).

The fix turns it effectively to:
    swprintf(..., L"%llo", (long long)8);
as it was previously done for 'x', 'd' and other int-like types.

Makes tests pass on powerpc64.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2017-10-03 04:17:56 +03:00
Aaron Gyes
1ef310c3a8 Fix export returning 1 on success
Fixes #4435
2017-10-01 01:11:17 -07:00
Aaron Gyes
635e714bb4 Make italics/dim work on MacOS
Work around ancient terminfo on MacOS by hard-coding the correct escapes.
Fixes #4436.
2017-09-29 14:25:09 -07:00
Fabian Homborg
281d468285 Rewrite systemctl completion with argparse
This

- Offers more candidates

- Is more reactive (it'll always incorporate "--state=" and "--type="

- Is faster (about 800ms to about 120ms)

- Needs fewer function files

All __fish_systemctl_* functions except __fish_systemctl_services have
been removed.
2017-09-29 20:07:18 +02:00
PenegalECI
fd33e3e2c6 Globally improved french translations (#4372)
* Globally improved french translations

* Corrected translations following comments
2017-09-29 04:01:48 -07:00
Mahmoud Al-Qudsi
d6cd98320d Update Changelog with completion changes not in 2.7.0 2017-09-26 16:01:42 -05:00
Mahmoud Al-Qudsi
42860da8ba Updated changelog for 2.7.0b1 from Integration_2.7.0
Squashed commit of the following:

commit fb252e6e10
Author: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Date:   Tue Sep 26 15:52:23 2017 -0500

    CHANGELOG.md: kdeconnect-cli, not kdecomplete

commit e031d91c19
Author: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Date:   Tue Sep 26 15:49:59 2017 -0500

    fixup! Updated changelog with info about all new and updated completions since 2.6.0

commit 6366a67c21
Author: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Date:   Tue Sep 26 15:36:37 2017 -0500

    fixup! Updated changelog with info about all new and updated completions since 2.6.0

commit 281be31eb3
Author: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Date:   Tue Sep 26 15:21:01 2017 -0500

    Updated changelog with info about all new and updated completions since 2.6.0
2017-09-26 16:01:01 -05:00
Aaron Gyes
5d8986fdad install linx.lss with Xcode project 2017-09-26 13:32:57 -07:00
Mahmoud Al-Qudsi
a1ae484dce Merge pull request #4428 from mqudsi/customlss
Use a custom Lynx style sheet (LSS file) to work around Lynx bug
2017-09-26 14:34:38 -05:00
Mahmoud Al-Qudsi
338311af1e Install custom LSS script to /usr/local/share/fish on make install
Decided to move doc_src/fish.lss to share/lynx.lss, which just makes
more sense all around. Accordingly, now using {$__fish_datadir} instead
of {$__fish_help_dir} in help.fish.

Makefile now installs the custom lss on make install
2017-09-26 14:31:11 -05:00
Mahmoud Al-Qudsi
8b858f2fcc Use a custom Lynx style sheet (LSS file) to work around Lynx bug
Lynx uses a very naïve method of applying styles to HTML elements by
hashing the element type and the class name to generate a map of
hash:style. After the hash is calculated, Lynx does not go back and
check whether or not the actual string values match the LSS properties.

See the following links on the Links mailing list:
 * http://lists.gnu.org/archive/html/lynx-dev/2015-12/msg00037.html
 * http://lists.gnu.org/archive/html/lynx-dev/2015-12/msg00039.html

This patch copies the default Lynx stylesheet but removes highlighting
and other styles that would result in unreadable text (due to not enough
contrast with the background color), and if the `help` builtin detects
that the best web browser to use is Lynx, it instructs it to use this
modified stylesheet.
2017-09-26 13:44:19 -05:00
Mahmoud Al-Qudsi
2b425ad221 Don't use xdg-open if running in terminal mode (i.e. no Xorg)
If the $DISPLAY environment variable is not set, xdg-open should not be
used to load the web browser. Just because it is installed does not mean
that the user exclusively runs in an X session.

Needed for Lynx detection to work around #4170
2017-09-26 13:42:40 -05:00
Mahmoud Al-Qudsi
c40188e40e Since cwd is a path, use PATH_MAX and not NAME_MAX 2017-09-26 10:00:23 -05:00
Mahmoud Al-Qudsi
b495c68f28 Fix non-standard getcwd() invocation
The POSIX standard specifies that a buffer should be supplied to
getcwd(), not doing so is undefined (or rather, platform-defined)
behavior. This was causing the getcwd errors on illumos (though not seen
on Solaris 11) reported in #3340

Closes #3340
2017-09-26 09:53:36 -05:00
Mahmoud Al-Qudsi
3b3bcc998e Speed up __fish_print_hostnames for faster completions
Thanks to @ThomasAH, as per #4378. Tested on many platforms (OS X,
FreeBSD, Linux, and Solaris). Works with IPv4 and IPv6 as well as
host names and loopback addresses.
2017-09-26 09:21:16 -05:00
Mahmoud Al-Qudsi
6513db35c1 Support colored ls output on Solaris 11
Closes #1223
2017-09-26 08:55:28 -05:00
Mahmoud Al-Qudsi
ffebe74885 Support building on Solaris 11
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
2017-09-26 08:19:33 -05:00
Mahmoud Al-Qudsi
9fdfe44236 Fix type of pid_status variable
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 *.
2017-09-26 08:16:36 -05:00
Mahmoud Al-Qudsi
3604522bf2 Removed gmake disclaimer from BSD build instructions
After cc35241a6e, BSD users can just call
make normally and have it redirect the build/install/test/whatever to
GNU Make.
2017-09-24 15:04:40 -05:00
Mahmoud Al-Qudsi
cc35241a6e Automatically pass build through to gmake on BSD
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.
2017-09-24 15:00:50 -05:00
Mahmoud Al-Qudsi
22a4ead36e Update README to include syntax highlighting
Use bash syntax highlighting to make comments appear in gray
2017-09-24 14:03:25 -05:00
Mahmoud Al-Qudsi
50f8ff1bc5 Make instructions after make install more uniformly formatted
Fixed indentation and quoting to match between all three commands
printed after `make install`
2017-09-24 13:58:13 -05:00
Mahmoud Al-Qudsi
56c041b889 Work around WSL access(2) EINVAL bug
See Microsoft/BashOnWindows#2522, Microsoft/BashOnWindows#2448
2017-09-24 13:43:50 -05:00
David Adam
6972dee37e travis: match CXXFLAGS to the defaults 2017-09-24 14:26:27 +08:00
David Adam
472e186c2b Rename FISH_HISTORY to fish_history
Work on #4414.
2017-09-24 14:07:45 +08:00
ridiculousfish
91ae39008a Correct prefix length calculation in completion measurement
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
2017-09-23 13:06:44 -07:00
Mahmoud Al-Qudsi
6b2e84be0e Merge pull request #4421 from krader1961/consistent-unicode
Use \uXXXX consistently for unicode code points
2017-09-22 21:13:20 -05:00
oddwheel
a05bcc6a63 Suppress git prompt CRLF warnings noise
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
2017-09-22 18:57:36 +02:00
Aaron Gyes
25d83ed0d7 seq fallback speedup
Using `string match` instead of `grep -E` resulted in a 2x-3x speedup according
to $CMD_DURATION.
2017-09-22 00:30:26 -07:00
Kurtis Rader
026cb48dce Remove unintended change from prev commit 2017-09-21 12:45:54 -07:00
Kurtis Rader
b241bf4140 Use \uXXXX consistently for unicode code points
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.
2017-09-20 22:00:14 -07:00
Mahmoud Al-Qudsi
fa9e445342 Add history-based completions for autojump's j command
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.
2017-09-20 20:50:10 -05:00
Mahmoud Al-Qudsi
46cf8c6bb7 Make build code snippets copy-and-paste friendly 2017-09-16 15:50:41 -05:00
Mahmoud Al-Qudsi
14e23749a6 Use inline code for paths and commands 2017-09-16 15:47:32 -05:00
Mahmoud Al-Qudsi
eac8158110 Lined up instructions output in make install 2017-09-16 15:36:37 -05:00
Kurtis Rader
67946b5509 Drop deprecated history search --with-time flag (#4403)
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.
2017-09-15 19:28:44 -07:00
Ed Brannin
9ac7da28bd Fix smurf_color variable name 2017-09-16 07:02:34 +08:00
Kurtis Rader
65dcd06ca1 mplement history search glob searches
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
2017-09-15 13:43:45 -07:00
Kurtis Rader
ee1d310651 Implement history search --reverse (#4375)
* 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()
2017-09-14 15:44:17 -07:00
Mahmoud Al-Qudsi
d0071960b8 fixup! Include make [test|all|install] in BSDmakefile 2017-09-14 14:35:05 -05:00
Mahmoud Al-Qudsi
9fd16d730b Include make [test|all|install] in BSDmakefile
If a build takes a long time, it's entirely possible to run `gmake` and
then forget to use GNU make and run `make install` after.
2017-09-14 14:29:22 -05:00
Mahmoud Al-Qudsi
5b61829a33 Emit error and GNU Make directions when compiled with BSD Make
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)
2017-09-14 14:17:51 -05:00
Mahmoud Al-Qudsi
864a1893bc Squashed commit of the following:
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 #4395

Closes #4396
2017-09-14 13:42:06 -05:00
Mahmoud Al-Qudsi
856c9cf8a1 Make s3cmd completions compatible with python3 environment
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.
2017-09-14 13:39:12 -05:00