Commit Graph

5325 Commits

Author SHA1 Message Date
David Adam
b4b52b8234 Don't set locale to en_US.UTF-8 unconditionally.
This is an unwise assumption, both for en_US and UTF-8; the fallback C
locale should be used instead.
2016-03-06 19:29:35 +08:00
David Adam
ed4b78918a fish.spec: dependency on net-tools/hostname depending on platform
Closes #2190.

[ci skip]
2016-03-06 19:24:19 +08:00
ridiculousfish
6bee85fefa expand_string should not return any results on error
Fixes #2796
2016-03-05 21:50:05 -08:00
ridiculousfish
a37d4d809e Save a few string allocations when importing environment variables 2016-03-05 19:07:00 -08:00
ridiculousfish
3044697baa Prefer the first, not last, of any env var duplicates
If envp contains duplicate environment variables, use the
first value, not the last value. Fixes #2784.
2016-03-05 19:02:50 -08:00
ridiculousfish
1e7c3fe709 A few fixes suggested by Coverity Scan 2016-03-03 18:49:24 -08:00
Fabian Homborg
333415f42a Fix stylistic nit in glob documentation
The test is unnecessary.
2016-03-03 10:30:53 +01:00
ridiculousfish
e3968ba872 Remove "w/o Background Color" text from Set Theme button in fish_config
This is important information but the Set button is the wrong place to
put it.
2016-03-02 15:02:28 -08:00
ridiculousfish
58d56f91f3 Tweak UTF8 decoding interface
Previously, when decoding UTF-8, we would first run through the
array to compute the correct size, then allocate a buffer of that size,
then run through the array again to fill the buffer, and then copy it
into a std::wstring. With this fix we can copy it into the string
directly, reducing allocations and only requiring a single pass.
2016-03-02 11:24:23 -08:00
Fabian Homborg
0e8a8a7c80 Migrate abbrs from =-separated to space-separated
We silently upgrade existing abbreviations and change the separator when
saving.

This does not yet warn when the user is using the old syntax.

Resolves #2051
2016-03-02 10:59:12 -08:00
Fabian Homborg
fbd53f2da1 Check ssh's KnownhostsFiles in print_hostnames
These are an additional source of information

Thanks to @sysbot (#2313) for the inspiration.

This also stringifies the ssh_config reading
2016-03-02 15:16:52 +01:00
Fabian Homborg
65aeaab054 print_hostname: Avoid matches in fstab comments harder 2016-03-02 15:16:52 +01:00
Fabian Homborg
94c12d84e2 Stringify reading nfs in print_hostnames 2016-03-02 15:16:52 +01:00
Fabian Homborg
a5f5e6c1ef Ignore zero-ips in print_hostnames
This would be a lot of useless options for those who block via hosts.
2016-03-02 15:16:42 +01:00
Jaime Marquínez Ferrándiz
61fd8b9861 history.fish: Fix input handling
Pass the input to 'string', it was accidentally removed in fcdc6a48c0.
2016-03-02 14:26:10 +01:00
Kurtis Rader
f2246dfb34 reduce number of Unicode private-use characters
This narrows the range of Unicode codepoints fish reserves for its own
use from U+E000 thru U+F8FE (6399 codepoints) to U+F600 thru U+F73F (320
codepoints). This is still not ideal since fish shouldn't be using any
Unicode private-use codepoints but it's a step in the right direction.

This partially addresses issue #2684.
2016-02-28 18:36:34 -08:00
Fabian Homborg
b41b962336 Clarify example in $PATH tutorial
See #2777
2016-02-29 00:12:26 +01:00
Fabian Homborg
5446841069 Ditch __fish_sgrep in obnam completions 2016-02-28 18:07:57 +01:00
Fabian Homborg
60bd3c809a Try to clarify test documentation for newbies
See #2773
2016-02-28 17:52:42 +01:00
Fabian Homborg
fb5a8a089e Use command which in type
Turns out some shells will alias which to be something function-aware,
but doing this on fish would blow up because it would call type which
would then call which which would then call type....

Fixes #2775
2016-02-28 12:12:13 +01:00
ridiculousfish
9151ec7092 Eliminate narrow_string_rep_t
This was used to cache a narrow string representation
of commands, so that if certain system calls returned errors
after fork, we could output error messages without allocating
memory. But in practice these errors are very uncommon, as are
commands that have wide characters. It is simpler to do a best-effort
output of the wide string, instead of caching a narrow string
unconditionally.
2016-02-28 01:38:28 -08:00
ridiculousfish
3633c51ad8 Re-use the parse tree generated during error detection for execution
Prior to this fix, read_ni would use parse_util_detect_errors
to lint the script to run, and then parser_t::eval() to execute it.
Both functions would parse the script into a parse tree. This allows
us to re-use the parse tree, improving perfomance.
2016-02-28 00:44:20 -08:00
ridiculousfish
e3970f9cbb Allow parse_execution_context to take ownership of a parse tree
Introduces a new template moved_ref which is like an rvalue reference.
This allows passing around objects while being explicit that the
receiver may acquire ownership. This will help reduce some allocations.
2016-02-28 00:33:11 -08:00
ridiculousfish
077757a30b Add missing #include guards in FISH_PAGER_H 2016-02-27 20:04:57 -08:00
ridiculousfish
211d626152 Remove unused MESS_SIZE define 2016-02-27 19:46:28 -08:00
ridiculousfish
e8aab9183e Remove some unnecessary statics and a silly #define const 2016-02-27 19:45:43 -08:00
ridiculousfish
10f3ea0008 Mark a bunch of constructors as explicit
This prevents undesired implicit conversions
2016-02-27 19:38:15 -08:00
ridiculousfish
88a785e321 Make expand_argument_list a static function
It doesn't use any properties of parser_t
2016-02-27 18:40:54 -08:00
ridiculousfish
d628fe0dea Eliminate parser_t::show_errors
Errors are now unconditionally shown
2016-02-27 18:37:59 -08:00
ridiculousfish
cbd3fa6b01 Eliminate parser_type_t
It was never fully implemented and wasn't used for anything
2016-02-27 18:25:58 -08:00
ridiculousfish
584cca59bf Allow -w option as short for --wraps in define_function
Fixes #2772
2016-02-27 17:47:23 -08:00
ridiculousfish
6cb48c6380 Allow variable completion from just a $
Previously there had to be some variable text, now you can
tab complete from just a naked $.
2016-02-27 16:51:44 -08:00
ridiculousfish
99be3ee96f Save a few allocations in src/parse_execution.cpp 2016-02-27 16:51:32 -08:00
ridiculousfish
c1c35e0f21 Fix a subtle problem that caused lots of unnecessary memory allocation 2016-02-27 16:51:28 -08:00
Kevin Ballard
d8a497434f Rewrite __fish_urlencode to not encode valid characters
Much better to only encode the characters that are not URL-safe. This
also doesn't involve any forking, and it even handles newlines and NULs
in the input.
2016-02-27 00:14:52 -08:00
Kevin Ballard
211829c586 Remove share/config.fish from .gitignore
This is a file under version control, there's no reason it should be
listed here. Having it in .gitignore was causing tools like `ag` to
avoid looking at share/config.fish.
2016-02-26 21:14:16 -08:00
Kevin Ballard
2bb7c587f4 Skip over /etc/paths.d entries that don't exist
I had an old /etc/paths.d/TeX file that listed a path /usr/texbin that
doesn't exist anymore. This was causing the `set PATH` to print a
warning.
2016-02-26 20:26:24 -08:00
Kevin Ballard
2187c0a84b Standardize indentation in config.fish 2016-02-26 20:22:59 -08:00
David Adam
c359d28b21 README updates
[ci skip]
2016-02-26 21:46:48 +08:00
Fabian Homborg
c1b384e5d3 Add functions and configuration snippets hierarchy
This allows "vendors" (i.e. third-party upstreams interested in
supporting fish) to add auto-loaded functions and eager-loaded
configuration "snippets", while still allowing both the user and the administrator to
fully override all of that.

This has been inspired by systemd's configuration hierarchy, and implements a similar scheme
whereby files with the same name in higher-ranking directories override files in lower-ranking ones.

Fixes #1956
2016-02-26 12:14:55 +01:00
Kurtis Rader
8b67a1b26f make testing on local servers hermetic
I noticed while fixing issue #2702 that the fish program being tested
was sourcing config.fish files outside of the current build. This also
happens when Travis CI runs the tests but isn't an issue there because
of how Travis is configured to execute the tests.

I also noticed that running `make test` was polluting my personal fish
history; which will become a bigger problem if and when the fishd universal
var file is moved from $XDG_CONFIG_HOME to $XDG_DATA_HOME.

This change makes it possible for an individual to run the tests on
their local machine secure in the knowledge that only the config.fish and
related files from their git repository will be used and doing so won't
pollute their personal fish history.

Resolves #469
2016-02-25 17:16:36 -08:00
Aaron Gyes
c79ade9627 Send BEL to terminal to flash/beep while trying to complete something not completeable. 2016-02-25 08:18:27 +08:00
David Adam
d61e95e4f9 Makefile: enable maintainer mode for PCRE2
Closes #2469.
2016-02-24 18:14:41 +08:00
David Adam
68807f274e github: add issues template
[ci skip]
2016-02-24 16:06:26 +08:00
Fabian Weisshaar
a805d401b8 add completions for diskutil (osx) 2016-02-23 13:54:46 +01:00
Adam Dymitruk
2f52f073da Update index.hdr.in
simple grammar correction
2016-02-22 13:36:35 -08:00
Steve Stagg
c4cc9f9b8d add files for the fish logo as used for the fish-shell stickers 2016-02-22 12:27:39 -08:00
ridiculousfish
6c401bc587 Resume sorting completions from wildcard expansions
Ought to fix the wildcard expansion test on Linux
2016-02-22 03:37:39 -08:00
ridiculousfish
35160db268 Remove an unused variable 2016-02-22 03:37:03 -08:00
Michael Steed
5b0996fd80 make fish compatible with pcre2 10.21
pcre2_substitute() now sets the output buffer length to PCRE2_UNSET (~0)
if the output buffer is determined to be too small. This change keeps
track of the buffer size separately where pcre2 can't touch it.

A better fix would be to let pcre2 tell fish what size buffer it needs.
This can be done with PCRE2_SUBSTITUTE_OVERFLOW_LENGTH, but this
requires pcre2 10.21 or later (released January 12), which may be too
new to introduce as a dependency at this point.

Fixes #2743
2016-02-21 19:32:08 -08:00