Commit Graph

6711 Commits

Author SHA1 Message Date
Fabian Homborg
f9664f224d Don't wrap pythonX completions
The issue here was that the `python` completion did a version check on
the `python` binary, so it would complete python2 stuff if system
python was py2, even if the user tried to complete `python3`.

This isn't beautiful, but it's more resilient than e.g. doing magic
with `commandline`.

Fixes #3840.
2017-02-11 16:07:06 +01:00
Kurtis Rader
0a929f7a0b don't export COLUMNS/LINES unless already exported
Fixes #3839
2017-02-10 15:20:09 -08:00
Markus Reiter
3e35e6e488 Use string split in alias. 2017-02-10 14:09:41 +01:00
Kurtis Rader
af7f5f42b6 put upper bound on data read will consume
This puts a hard upper bound of 10 MiB on the amount of data that read
will consume. This is to avoid having the shell consume an unreasonable
amount of memory, possibly causing the system to enter a OOM condition,
if the user does something non-sensical.

Fixes #3712
2017-02-09 21:04:46 -08:00
Kurtis Rader
f27407bbf9 correct German translation strings
Fixes #3834
2017-02-09 13:32:30 -08:00
Fabian Homborg
214c677032 Remove outdated completions
These are dead projects with completions that didn't provide much
value.

Fixes #3662.
2017-02-09 18:42:55 +01:00
Cristian Prieto
2bbecf4292 Yarn completion (#3816)
* Add main yarn commands and subcommands

* Add more short/long options

* Add subcommands for most main commands

* Add suboptions for mutext and access
2017-02-09 17:24:38 +01:00
Kurtis Rader
0541a34201 improve bash command history importing
Fixes #2091
2017-02-08 20:50:57 -08:00
Jeff Dickey
cf63d1b2a7 added mocha.fish 2017-02-08 14:22:30 -08:00
Andrei Dziahel
85ba4e0142 Fix colors table (#3826)
* color: make brgrey really grey

The 0055 value is actually 0x2d which isn't 0x55 mentioned further and is probably a typo

* color.cpp: reformat color table

Tidy color table up and also fix hex number case for grey color. This should ease spotting errors like one from previous commit.
2017-02-08 13:49:19 -08:00
Kurtis Rader
9b24d26972 document creating - abbreviation in FAQ 2017-02-08 13:22:47 -08:00
Kurtis Rader
0970cc8736 time for another make style-all 2017-02-07 21:52:35 -08:00
Kurtis Rader
616d301083 set stdout to unbuffered if attached to a tty
Fixes #3748
2017-02-07 21:01:22 -08:00
ridiculousfish
162053ed8d Make history file rewriting be more lock savvy
We now are stingier with taking history file locks - if the lock
is held too long we may just break it. But the current file save
architecture holds the lock for the duration of the save. It also
has some not-quite-right checks that can cause spurious failures in
the history stress test.

Reimplement the history save to retry. Rather than holding the lock,
rewrite the file to a temporary location and then take the lock. If
the history file has changed, start all over.

This is going to be slower under contention, but the advantage is that
the lock is only held for a brief period (stat + rename) rather than
across calls to write().

Some updated logic also fixes spurious failures that were easy to observe
when tsan was enabled. These failures were due to failing to check if the
file at the path was the same file we opened.

The next step is to move the history file saving to a background thread
to reduce the chances of it impacting user's typing.
2017-02-06 11:04:07 -08:00
ridiculousfish
f9371899a1 Including missing atomic header in history.cpp 2017-02-06 10:51:27 -08:00
ridiculousfish
56b60fab4b Improve history's save_internal_via_appending
Allow retrying, fix an issue where we trip over our own changes
by thinking the file has changed when we are responsible for changing
it, and improve some commenting
2017-02-06 10:39:07 -08:00
ridiculousfish
b91a2dd0bb Factor map_fd out of map_file
Will enable us to map an already-opened file
2017-02-06 10:09:31 -08:00
ridiculousfish
83f386347f Make file_id_for_fd return kInvalidFiledID when passed a negative fd
Rather than making fstat do this, make it explicit.
2017-02-06 10:01:33 -08:00
ridiculousfish
6eb1e31070 Add some safety to history_file_lock
Use an atomic to avoid TSAN complaints, and ensure that we don't
leave the file locked if we've decided to give up on locking.
2017-02-06 10:00:34 -08:00
ridiculousfish
e3c538a991 Simplify history_output_buffer_t
This class is used to accumulate data to be written to the history
file. It has some dubious optimizations around trying to track an
offset separately from the size of the buffer. After some investigation
these aren't helping, vector behaves fine on its own. So just make
this a simple wrapper around vector.
2017-02-06 10:00:01 -08:00
René Schwaiger
908ed493cc Fix wildcard bug in __fish_print_filesystems
Before this change the function `__fish_print_filesystems` would print
an error message about an empty wildcard match for the pattern
`$PATH/mount.*`, if the current operating system does not include any
helper binaries for the command `mount`. An example for such an OS is
the current version of macOS (version 10.12).
2017-02-06 08:08:54 -08:00
Rabah Meradi
a5e8b81ee3 Add completion for climate 2017-02-05 19:22:35 -08:00
Kurtis Rader
c4f2210cc5 cache prompts and escape sequences we've seen
Cache the escape sequences we've seen when checking for those which
don't take any visual space when writing the prompt or similar strings.
This reduces the cost of determining the true cost of such strings by a
full order of magnitude if they include lots of such escape sequences.

Periodically sort the cached escape sequence lengths based on feedback
from cache hits so that we're always checking for the most likely
sequence lengths first.

Also cache the prompt layouts to avoid doing the calculations if the
prompt doesn't change.

Fixes #3793
2017-02-05 18:31:14 -08:00
Kurtis Rader
6d72d538a6 refactor escape_code_length()
Step one in addressing issue #3793
2017-02-05 18:31:14 -08:00
Aaron Gyes
279ec88351 Fix PR template typo
Thanks @sanssecours for noticing.
2017-02-05 10:39:51 -08:00
ridiculousfish
8a09c99f36 Escape in vi mode to end paging, but stay in insert mode
Change the escape key binding in insert mode (in vi key bindings)
to check if we are in paging mode. If so, emit cancel and stay in
insert mode. Otherwise perform the current behavior of switching
back to default mode and adjusting the cursor.

Fixes #2871
2017-02-05 02:49:52 -08:00
ridiculousfish
56161250de Make a missing --sets-mode property for a key binding do nothing
Currently, if bind is run with --mode but not --sets-mode, the
binding gets an implicit --sets-mode equivalent to the mode. This
is usually unobservable but it may matter if the mode is changed
by some internal part of the binding (e.g. set fish_bind_mode...)
then that setting will be lost after the binding is complete.
2017-02-05 02:49:45 -08:00
David Adam
41a49b014a Makefile: use recursively expanded variable for the list of manpages
Restores the installation of manual pages when running `make install`
without running `make` first, a bug introduced with 417255fc.

Closes #3813.
2017-02-05 14:22:16 +08:00
David Adam
8339e28cfe build_tools/list_committers_since.fish: tool for showing new & returning committers 2017-02-04 21:04:03 +08:00
Fabian Homborg
b3d5fb71f4 completion generator: Protect against undefined variable
Proc wasn't defined if $MANPATH was used.

Fixes #3808.
2017-02-03 18:32:14 +01:00
Fabian Homborg
94b71353ef completion generator: Define parent_paths directly if MANPATH is set 2017-02-03 18:32:14 +01:00
David Adam
3e17b8fccc add CHANGELOG note to pull request template
[ci skip]
2017-02-03 21:17:25 +08:00
David Adam
40428f592d bump metadata following 2.5.0 release
[ci skip]
2017-02-03 21:17:17 +08:00
David Adam
49e98cde4c Merge branch 'Integration_2.5.0' 2017-02-03 21:14:40 +08:00
David Adam
708d6b6911 Bump version for 2.5.0 2017-02-03 09:46:58 +08:00
David Adam
c3dddee804 CHANGELOG: updates for 2.5.0 2017-02-03 09:44:59 +08:00
Clément Martinez
47ad707bba Add jq completions 2017-02-02 23:07:54 +01:00
Terje Larsen
bf84879134 Add completions for minikube (#3778)
* Add completions for minikube

This adds basic completions for minikube, the subcommands and their options.

* Improve minikube completions

- Use more consistent and shorter descriptions.
- Fix subcommand options
- Add more semantic completions

* Fix named variable for option value

* Add completions for minikube addons enable/disable

* Add completions for minikube addons open
2017-02-02 17:45:42 +01:00
Fabian Homborg
b7cdb6d586 Merge pull request #3757 from nim65s/master
systemctl completions: add cat & edit commands

Also use systemd version to determine the commands it knows.
2017-02-02 17:44:07 +01:00
Kurtis Rader
088b10f4c2 style fixes to previous commit
This commit addresses many of the style problems with the previous
commit. If this introduces any bugs they are solely my fault. The style
of this code needs more improvement. Some of which could be done today.
Others will have to wait until `fish_indent` is improved.
2017-02-01 22:49:40 -08:00
Dale Eidd
eff6b98813 numerous improvements to ssh/scp completions
Add IPV6 /etc/hosts completion support. Parses columns rather than values which produces improved output.

Support ssh -F and Include completion

Ignore ssh Hostname and Host with wildcard. The following only get in the way:

- Hostname: Host resolves to Hostname
- Wildcard Host: Cannot ssh to a glob pattern

Improve scp completions

* complete only local files when no host provided
* complete only remote files when host is provided
* complete local files or hosts when no separator

Disable username completion for ssh/scp

Username completion only provides local users which will unlikely be
useful on a remote machine. ssh will use the current username (the only
useful one) or one provided in the ssh config.
2017-02-01 22:12:49 -08:00
Kurtis Rader
949fc7bdd7 fix IWYU lint
Commit 8645aa94 was made because it seemed necessary at the time.  However,
when I run `make lint-all` now it complains about include loops for header
`signal.h`. This reverts part of that earlier commit to get sane behavior
from IWYU again.
2017-02-01 22:06:24 -08:00
Kurtis Rader
44cfe3e340 remove dependency on xxd
Fixes #3797
2017-01-31 22:10:53 -08:00
Clément Martinez
2b13472419 Improve htop completion
Add new options
Add description at the top of the file
Fix `--sort-key` completions
2017-01-31 15:52:55 -08:00
Clément Martinez
9d5471722f Improve help completions 2017-01-31 15:52:55 -08:00
Clément Martinez
0447ee7b96 Improve go completions 2017-01-31 15:52:55 -08:00
Clément Martinez
cd58e6129c Improve grep completions 2017-01-31 15:52:55 -08:00
ridiculousfish
f48291b70c Add #include<atomic> to env_universal_common.cpp
Should fix the Linux builds
2017-01-30 13:41:17 -08:00
ridiculousfish
2a472af7b8 Add sanity checking to LRU cache 2017-01-30 12:59:01 -08:00
ridiculousfish
927a678056 Add support for sorting in LRU caches
Performs an in-place merge sort
2017-01-30 10:25:17 -08:00