Commit Graph

8885 Commits

Author SHA1 Message Date
ridiculousfish
8b83fe1ff7 Simplify yet more memory management in argparse 2018-07-21 19:13:10 -07:00
ridiculousfish
c269ef2c5d Copy strings less in argparse 2018-07-21 18:53:03 -07:00
ridiculousfish
3c4c47f516 Clean up some memory usage in argparse
Clarify some ownership models
2018-07-21 18:52:54 -07:00
ridiculousfish
a374b8ede7 Simplify splitting on commas in argparse 2018-07-21 17:25:16 -07:00
ridiculousfish
e2a3dae58b Don't require ./etc to exist in relocatable fish
fish tries to be relocatable by looking for directories relative to its
executable. These directories are not found when running fish from
within a cmake build because the etc directory is not present. Stop requiring
this directory to be present since it's not critical for running fish.

Fixes #4825
2018-07-21 16:47:00 -07:00
ridiculousfish
0f568d4f66
Merge pull request #5104 from ridiculousfish/expect_tests
Teach cmake to run expect tests
2018-07-21 16:03:58 -07:00
ridiculousfish
11502c0d36 Teach cmake to run expect tests
Fixes #4794
2018-07-21 15:43:31 -07:00
ridiculousfish
57cc3d950d Remove some unnecessary test output 2018-07-21 15:31:14 -07:00
ridiculousfish
dae2809531 Fix a few warnings 2018-07-21 14:35:39 -07:00
ridiculousfish
a11e955c84
Merge pull request #5097 from ridiculousfish/history_read
Don't mmap history files on remote file systems

This merges some changes to history that may help to mitigate the crashes seen in #5088 . These SIGBUS crashes occur when reading a memory mapping whose underlying file was truncated. It's not clear why this should occur more often on NFS (or ever). However memory mapping over NFS is sketchy anyways so this is desirable regardless.
2018-07-21 13:51:49 -07:00
ridiculousfish
c636a455a0 Add locking to try_complete_user
This uses the thread-unsafe getpwent(). Add a lock around the whole section
to avoid the crash identified in #5088
2018-07-15 15:50:56 -07:00
ridiculousfish
4d1eeef3db Stop trying to mmap the history file on remote fs
When the history file is on a remote filesystem, memory mapping is suspicious.
Never mmap in this case.
2018-07-15 15:26:36 -07:00
ridiculousfish
679437d6a9 Implement fd_check_is_remote
This adds a new function fd_check_is_remote() which is designed to determine
if a file lies on a remote (SMB, NFS, etc.) filesystem.
2018-07-15 15:26:36 -07:00
ridiculousfish
a39734cbed Encapsulate history mmap logic
Migrate the mmap() logic into a new class history_file_contents_t which
will serve to encapsulate conditional logic if we choose to use read()
instead of mmap().
2018-07-15 15:26:27 -07:00
ridiculousfish
63e0a3d7c2 Misc cleanup in history_t
Add some C++11
2018-07-15 14:33:38 -07:00
ridiculousfish
2ce0240fc8 Add a time_profiler for reading old history items 2018-07-15 14:33:38 -07:00
David Adam
c5ec7daab4 Revert "license.hdr: add Apache2 license for wcwidth9"
This reverts commit 00f2099f29. wcwidth9
has been removed.
2018-07-14 15:43:37 +08:00
James Lee
e26bdff487 Improve eopkg completions by using the --installed flag (#5089)
Utilized the `--install` flag added in commit #8c09d6e.

Limit `eopkg remove/autoremove/check ...` completions to installed packages.
Limit `eopkg install/upgrade/info ...` completions to available packages.
2018-07-09 23:21:44 -07:00
ridiculousfish
6a6ffe68cb Make __fish_describe_command stop barfing on /
Prior to this fix, __fish_describe_command would error if the
input contained any special characters, because it would be interpolated
into a regex. Hack in a guard to do nothing if the input contains
anything other than [a-zA-Z0-9_ ]
2018-07-09 23:13:53 -07:00
ridiculousfish
87f646d84d Correct spelling of 'consistently' 2018-07-09 20:55:55 -07:00
gkdoc
c04cb9c715 Update FORMATTING.md (#5087) 2018-07-09 20:54:56 -07:00
ridiculousfish
28455235b1 Migrate to widechar_wcwidth
Adopt the new widechar_wcwidth() function from
https://github.com/ridiculousfish/widecharwidth

Fixes #5081
2018-07-09 20:31:16 -07:00
David Adam
7de9563aad docker completions: add dummy file noting they are upstream
Suggested in #5090.
2018-07-08 21:38:08 +08:00
Guilhem Saurel
994f5c500b update nim.fish sample prompt (#5066)
* update nim.fish sample prompt

- Use an helper function to wrap informations
- Add VIRTUAL_ENV infos, if any
- Add __fish_git_prompt, wrapped for the theme
- Add comments
- Remove ASCII failback symbols for tty
  (no more useful for me, but if someone really needs it, just ask)

* fish.nim: test -n __fish_git_prompt
2018-07-05 22:30:52 +02:00
Simon Legner
dfbffd13df [completions/git] Fix typo 2018-07-05 22:28:52 +02:00
Mahmoud Al-Qudsi
eec4b399b5 Fix accidental recursive invocation of make under BSD
The backticks in the cmake not installed error message were not
escaped, leading to accidental recursive invocation of `make`.
2018-07-04 20:51:06 -05:00
Fabian Homborg
7ead8f459e [completions/git] Offer containing directories
Fixes #5083.
2018-07-04 15:11:32 +02:00
Sam Yu
495c09fe6b Add subcommand options completion for zypper 2018-07-03 13:45:39 -07:00
Mahmoud Al-Qudsi
8c09d6e063 Limit apt remove ... completions to installed packages only
Added a new flag `--installed` via `argparse` to `__fish_print_packages`
which indicates that only installed packages should be listed.

TODO: Other non-debian/apt platforms should take advantage of this flag/
behavior as well.
2018-07-02 11:43:18 -05:00
ridiculousfish
84b7c2b152 Merge branch 'string_split0'
This merges support for `string split0` and `string join0`, easing working
with nul-separated output.

Fixes #3164
2018-07-01 16:41:29 -07:00
ridiculousfish
62d73bee5e Add string split0 and join0 to changelog 2018-07-01 16:35:23 -07:00
ridiculousfish
73c747d162 Add string join0
string join0 joins its arguments using NUL byte, which complements
string split0. For example it allows piping a variable through sort -z.
2018-07-01 15:56:34 -07:00
ridiculousfish
b1176323e7 Document string split0 2018-07-01 15:56:34 -07:00
ridiculousfish
d34a300818 Add string split0
This adds a new string command split0, which splits on zero bytes.
split0 has superpowers because its output is not further split on
newlines when used in command substitutions.
2018-07-01 15:56:33 -07:00
ridiculousfish
f998afaa23 Adopt separated_buffer_t in io_buffer_t 2018-07-01 15:56:33 -07:00
ridiculousfish
90a4af5112 Add separated_buffer_t and adopt it in output_stream_t
separated_buffer_t encapsulates the logic around discarding (which
was previously duplicated between output_stream_t and io_buffer_t),
and will also encapsulate the logic around explicitly separated
output.
2018-07-01 15:56:33 -07:00
ridiculousfish
5b9331ade0 Teach io_buffer_t to append from output_stream_t directly
This will simplify logic when we teach output_stream_t about explicitly
split outputs, i.e. for 'string split0'
2018-07-01 15:56:33 -07:00
ridiculousfish
369890cdd9 Clean up io_buffer_t interface 2018-07-01 15:56:33 -07:00
David Adam
a6031c42bf __fish_config_interactive: make default colours the same as web_config's default 2018-06-29 21:49:35 +08:00
David Adam
dc17869a84 commandline docs: add note that -b selects autosuggestion
Suggested in #5000.
2018-06-29 21:28:46 +08:00
David Adam
00f2099f29 license.hdr: add Apache2 license for wcwidth9
The wcwidth code is derived entirely from neovim, not from vim.
2018-06-29 21:27:29 +08:00
Fabian Homborg
817adc123d [completions/git] Don't use --ignored=something
It was only introduced in 2.16, which was released in January 2018.

Instead, we just use a bare "--ignored", which is equivalent to "--ignored=traditional".

The difference to "--ignored=matching" mode shouldn't matter to us here.

Fixes #5074.
2018-06-27 22:02:49 +02:00
Mahmoud Al-Qudsi
144af5116a Allow functions -e completions to complete hidden __fish functions
...but only if the user has started their function name argument with an
underscore.
2018-06-27 14:42:42 -05:00
Mahmoud Al-Qudsi
092307d4c0 Include whatis description for kernel modules in kldload completions
Using `__fish_whatis` based on a heuristic to make sure completions are
timely available.
2018-06-27 14:38:51 -05:00
Mahmoud Al-Qudsi
121c70cf39 Add completions for FreeBSD's kldunload
Lists currently loaded kernel modules as valid completions, and obtains
a description via the newly minted `__fish_whatis` if available.
2018-06-27 14:14:40 -05:00
Mahmoud Al-Qudsi
948b9d2ab8 Add __fish_whatis helper function/wrapper for whatis
Executes `whatis` safely, returns at most one line, and strips the name
of the command from the start of line, returning a value fit for use as
the description parameter for a completion argument value.
2018-06-27 14:14:40 -05:00
Dale Eidd
8e49229d8f Fix & improve ssh_config Include directive for hostname printing
Fixes
- Use the actual path when skipping unusable paths to fix all Include
  directives being skipped when there is no ~/.ssh directory
- Prevent "No matches for wildcard" message

Improvements
- Skip paths that are directories since we only want files
- Remove `cd` as it is not needed
2018-06-27 14:07:11 +02:00
Mahmoud Al-Qudsi
49bfc4f000 fixup! Fix __fish_complete_suffix behavior for paths with literal . 2018-06-25 20:59:24 -05:00
Mahmoud Al-Qudsi
72d80c3d91 Fix __fish_complete_suffix behavior for paths with literal .
__fish_complete_suffix assumed that the only literal . in a path
would be the . before an extension, and stripped accordingly. This
behavior has been there for a long time, but broke many things
including completion of relative paths and completion of paths with
a literal . in a directory name.

__fish_complete_suffix does not just complete extensions (or at the
very least, it no longer does just that) but rather any suffix, so
isolating the path name without the extension was unnecessary in all
cases.
2018-06-25 13:54:10 -05:00
Fabian Homborg
cbdd347ec6 Changelog range expansion change, expand docs 2018-06-25 17:57:06 +02:00