7659 Commits

Author SHA1 Message Date
Kurtis Rader
f872f25f5b change env_var_t to a vector of strings
Internally fish should store vars as a vector of elements. The current
flat string representation is a holdover from when the code was written
in C.

Fixes #4200
2017-08-18 16:24:30 -07:00
Kurtis Rader
6e02ec83d1 Fix typo in xdg-mime completion functions 2017-08-17 10:54:05 -07:00
MoritzKn
5eb0b34da1 Update xdg-mime helper
This will respect the `/usr/local/share/applications/` directory when
fetching mime infos.

Update xdg-mime helper to comply with the xdg spec.

This also makes sure __fish_print_xdg_applications_directories only prints
directories that exist.

Relevant specs:
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
https://specifications.freedesktop.org/desktop-entry-spec/latest/ape.html
2017-08-17 10:50:06 -07:00
Matus Goljer
c611943cc2 Add completion for packages in update subcommand
This patch adds completion for the update subcommand, that is, when the
user types in `composer update <tab>`.

The code depends on python for the json parsing.  I'm not sure if this
is appropriate or if there is a fish-native way to parse json data.

Use suggestions for remove subcommand.

Add suggestions for why, why-not and depends.

Add why/why-not suggestion.
2017-08-17 10:32:15 -07:00
Georgy Yakovlev
58425ed463 Do not redirect to / in status.in/err test. 2017-08-17 10:22:30 -07:00
Kurtis Rader
ea45541d53 fix set --show of semi-empty var
A semi-empty var is one with a single empty string element. The
`env_var_t::empty()` method returns true for such vars but we want
`set --show` to report that it has a single empty element.
2017-08-16 13:39:48 -07:00
David Adam
dcb39bfa86 Revert "Enable support for custom versioning"
This reverts functional changes in commit
3bef4a3c1f4cdb631f6e46da86fa56617edea778.

 * Annotated tags only should be used for releases - see #3572 for
   examples of where we want to use lightweight tags.

   See also git-tag(1) on the purpose of annotated and lightweight tags.

 * Version numbers are numbers and should not start with a branch name.

   The commit ID is embedded in the version and uniquely identifies the
   history. `fish --version` and `echo $FISH_VERSION` contain this
   information.
2017-08-16 20:54:39 +08:00
Kurtis Rader
3bef4a3c1f Enable support for custom versioning
Now that we're working on the 3.0.0 major release it is more important
than ever that fish binaries built by developers have version strings
which clearly communicate where they came from.
2017-08-15 12:43:11 -07:00
Kurtis Rader
4fbc2e4bdb Merge branch 'master' into major 2017-08-14 20:14:39 -07:00
sentriz
72173a93a7 Accept return as a valid answer to 'Edit the file again?'
Also, check for affirmative answer so a random string isn't taken as a
"yes" response.
2017-08-14 18:18:41 -07:00
Andrew Toskin
058e23720f Clarify notes on dependency errors, tests, and VCS integration.
An optional feature that suggests you install Python is okay;
core-dumping is not.

The note on tests was about fish development tests, not the `test`
builtin for conditional syntax.

Specifically mention git, hg, and svn in the VCS section.
2017-08-14 18:18:10 -07:00
Andrew Toskin
29494d8546 Clarify dependencies: required vs optional, and build vs runtime.
A first pass at updating the dependency documentation, based on the
discussion in this thread:
https://github.com/fish-shell/fish-shell/issues/2062
2017-08-14 18:18:10 -07:00
Fabian Homborg
298c580e72 Clarify docs on $status with and/or/begin/end
See #4311.
2017-08-14 18:18:10 -07:00
Fabian Homborg
4e2b11f2e0 help: Fix error if no argument is given 2017-08-14 18:18:10 -07:00
Andrew Toskin
146c62c603 getopt isn't used anymore, and getent itself is optional.
getopt doesn't work very well in the BSDs, and getent has plenty of
fallbacks to replace it when it's not available.

<https://github.com/terrycloth/fish-shell/commit/
47a768ceeaef1d702624802d83338edbcc0f377c#commitcomment-23613921>
2017-08-14 18:18:10 -07:00
Mahmoud Al-Qudsi
e6bb7fc973 Silence unused result warnings on newer compilers
Newer versions of GCC and Clang are not satisfied by a cast to void,
this fix is adapted from glibc's solution.

New wrapper function ignore_result should be used when a function with
explicit _unused_attribute_ wrapper is called whose result will not be
handled.
2017-08-14 18:18:10 -07:00
Andrew Toskin
5356384d0a Really spell out the last of the required UNIX utilities.
Finishing the job started in Pull Request #4301

<https://github.com/fish-shell/fish-shell/pull/4301>

Thanks to @faho for filtering and sorting my giant list of detected
possible commands.

<https://github.com/fish-shell/fish-shell/issues/2062#issuecomment-321788080>
2017-08-14 18:18:10 -07:00
David Adam
88134a2465 Revert "configure: check that errno is threadsafe"
This reverts commit ee15f1b9877834f49342a7bd93457e423eeb2cb4.

The test relies on undefined behaviour (checking for errno in the
absence of an error condition) and was broken on OpenBSD.

Closes #4184.
2017-08-14 18:18:10 -07:00
David Adam
487dc98468 docs: update language in read documentation 2017-08-14 18:18:10 -07:00
Kurtis Rader
42ddab0cb4 make missing_var a singleton
Make the `env_var_t::missing_var()` object a singleton rather than a
dynamically constructed object. This requires some discipline in its use
since C++ doesn't directly support immutable objects. But it is slightly
more efficient and helps identify code that incorrectly mutates `env_var_t`
objects that should not be modified.
2017-08-14 18:18:10 -07:00
Kurtis Rader
58b604c5ba change order of env_set() args
It's bugged me forever that the scope is the second arg to `env_get()`
but not `env_set()`. And since I'll be introducing some helper functions
that wrap `env_set()` now is a good time to change the order of its
arguments.
2017-08-14 18:18:09 -07:00
Mahmoud Al-Qudsi
fa4cf77aff Ignore more invalid arguments from parsed man pages
Specifically closes #4313.
Not being as agressive in what we ignore/blacklist, but can be revisited
easily in the future to add more characters to the argument blacklist.
2017-08-14 18:18:09 -07:00
peoro
5ceac038b1 Improved warning message when exiting with jobs still active
Fixes #4303
2017-08-14 18:18:09 -07:00
David Adam
7b92217273 docs: improve set -Ux language and example
By far the most common problem with universal variables being overridden
by global variables is other values being imported from the environment;
the `set -q; or set -gx` is much more of an edge case.
2017-08-14 18:18:09 -07:00
Kurtis Rader
74f0be2a53 remove more ENV_NULL references 2017-08-14 18:18:09 -07:00
Kurtis Rader
82b5ba1af4 fix bug in env_get() involving empty vars
My previous change to eliminate `class var_entry_t` caused me to notice
that `env_get()` turned a set but empty var into a missing var. Which
is wrong. Fixing that brought to light several other pieces of code that
were wrong as a consequence of the aforementioned bug.

Another step to fixing issue #4200.
2017-08-14 18:18:09 -07:00
Kurtis Rader
728a4634a1 replace var_entry_t with env_var_t
This is a step to storing fish vars as actual vectors rather than flat
strings.
2017-08-14 18:18:09 -07:00
Fabian Homborg
745a88f2f6 Revert "Fix clearing abandoned line with VTE (#4243)"
Unfortunately, this breaks the expect tests.

So, until I can figure out how to unbreak them:

This reverts commit 09cb31a172773761a305f7353b44e9bb056a5d98.
2017-08-14 18:17:34 -07:00
Fabian Homborg
cf00162340 Fix clearing abandoned line with VTE (#4243)
* Fix clearing abandoned line with VTE

With VTE-based terminals, resizing currently causes multi-line prompts
to go weird.

This changes the sequence we use to clear the line to one suggested by
a VTE
developer (https://bugzilla.gnome.org/show_bug.cgi?id=763390#c4).

It changes nothing in konsole 17.04.3 and urxvt 9.22, but they already
work.

Note that this does not fix the case where output did not end in a
newline, but that doesn't seem to be up to us. Also, it only affects
those lines.

Fixes #2320.

* Use terminfo definition instead of hardcoding

Thanks to @ixjlyons.
2017-08-14 18:17:34 -07:00
Kurtis Rader
886fc38d55 fix typo introduced by an earlier revert 2017-08-13 16:15:12 -07:00
Kurtis Rader
ef25d8c76d Revert "rewrite abbr function"
This reverts commit 17dff8c569a4bbbe88d23c77e043574d15804093.
It was meant for the major branch.
2017-08-13 15:44:31 -07:00
Kurtis Rader
e6fbb93d31 Revert "implement limits on command substitution output"
This reverts commit 4197420f3968093ec12075f1eac06ed1570a8e30.
It was meant for the major branch.
2017-08-13 15:39:13 -07:00
Kurtis Rader
10498059e4 Revert "document command substitution data limit"
This reverts commit 2bbcc5cbc80966d80576d1c30c14442ef6a6268e.
2017-08-13 15:36:39 -07:00
Kurtis Rader
9cb2554423 Revert "implement set --append and set --prepend"
This reverts commit 67de733b9b2262d424fa1f656157c952a9168b2b.
It was meant for the major branch.
2017-08-13 15:33:50 -07:00
Kurtis Rader
088b21a15f Revert "use the new set -a and set -p in our scripts"
This reverts commit 8b79f4e5c93acf7e643ef5b7b854fa7ad5a39487.
It was meant for the major branch.
2017-08-13 15:32:16 -07:00
Kurtis Rader
296008089c Revert "stop subclassing env_var_t from wcstring"
This reverts commit c36ad2761892a8f7dbb9cffc1ab2c2a470b93bf5.
It was meant for the major branch.
2017-08-13 15:31:56 -07:00
Kurtis Rader
7876bc6ef3 Revert "make tokenize_variable_array() private"
This reverts commit 4fe9d794382b6b81967e6ee88c76403bb8a69541.
It was meant for the major branch.
2017-08-13 15:30:54 -07:00
Kurtis Rader
7dd2cd7de7 Revert "Revert "finish cleanup of signal blocking code""
This reverts commit 35ee28ff24c7bca933d477029c7f3386cfbaf9a3.
It was meant for the major branch.
2017-08-13 15:30:34 -07:00
Kurtis Rader
7776a03fb3 Revert "Fixes a race condition in output redirection in job chain"
This reverts commit cdb72b70248a67920002396179426e45e271d170.
It was meant for the major branch.
2017-08-13 15:30:17 -07:00
Kurtis Rader
c304ca1a1c Revert "Explicitly nulling chained_wait_prev after munmap()"
This reverts commit 47d8a7e8820382d3957f4bebbac79e5fd24d3d7f.
It was meant for the major branch.
2017-08-13 15:30:09 -07:00
Kurtis Rader
4429518667 Revert "Using SIGSTOP/SIGCONT instead of mmap & sem_t to synchronize jobs"
This reverts commit cafd856831507f0599f5ea24231a3ee25f62d174.
It was meant for the major branch.
2017-08-13 15:29:59 -07:00
Kurtis Rader
635365654d Revert "Fixed cases where first command in chain would stay blocked"
This reverts commit fb13b370e26b66fee6f662ac58e06ed04b47fbc9.
It was meant for the major branch.
2017-08-13 15:29:50 -07:00
Kurtis Rader
950c7ef2eb Revert "fixup! Using SIGSTOP/SIGCONT instead of mmap & sem_t to synchronize jobs"
This reverts commit f653fbfaf4bfea2a21e7d9b6dfebc9ceaa9ca58d.
It was meant for the major branch.
2017-08-13 15:29:41 -07:00
Kurtis Rader
e0ccb8c48e Revert "Improved blocked prcoess comments, clarified job vs command chain"
This reverts commit dfac81803b0da9fc1fd1d71f2f01abb1909dfc07.
It was meant for the major branch.
2017-08-13 15:29:33 -07:00
Kurtis Rader
8ebba2066d Revert "Fixed race condition in new job control synchronization"
This reverts commit 87394a9e0b1aba875b2ccb1c03ba0314ba41ff9e.
It was meant for the major branch.
2017-08-13 15:29:22 -07:00
Kurtis Rader
158b946eac Revert "Don't attempt to unconditionally tcsetpgrp"
This reverts commit 0e9177b59090e1f7bab048436b7c625ef3544947.
It was meant for the major branch.
2017-08-13 15:29:09 -07:00
Kurtis Rader
559f8d5511 Revert "Don't indiscriminately unblock previous cmd for internal builtin/functions"
This reverts commit c81cf56c0b6355e9d5e50d74e56fc00e1039d40a.
It was meant for the major branch.
2017-08-13 15:28:59 -07:00
Kurtis Rader
9d5990eda7 Revert "Changed how process groups are assigned to child processes"
This reverts commit 25afc9b377de5255673276314bf9d26a3b43cbab.
It was meant for the major branch.
2017-08-13 15:28:48 -07:00
Kurtis Rader
8d53b72e46 Revert "Set child process group in case of posix_spawn"
This reverts commit 9f2addcf27f5f62b367ab47e3b31ccffa68e5cc6.
It was meant for the major branch.
2017-08-13 15:28:38 -07:00
Kurtis Rader
9af7720f19 Revert "Fixed exec failure regression"
This reverts commit 8b8a21dcad2505aec15753f308045ae739eda918.
It was meant for the major branch.
2017-08-13 15:28:28 -07:00