Commit graph

9053 commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
e160cde606 Implement PCRE2 escaping
Closes #5309.
2018-11-15 12:00:56 -06:00
Mahmoud Al-Qudsi
f56c317bd0 Add note about literal 0 indices to changelog
[ci skip]
2018-11-14 23:35:03 -06:00
Fabian Homborg
1fffdbce79 Fix status current-command
As it turns out, this just always printed "fish".

The solution here is a bit hacky as we go via the $_ variable.

Fixes #5339.
2018-11-14 12:15:40 +01:00
Fabian Homborg
278cbc5ff1 env_universal_common: Constref env_var_t as well 2018-11-14 12:15:40 +01:00
Fabian Homborg
8343e61795 cppcheck: Suppress incorrectStringBooleanError
This triggers on `assert(condition && "message")`, which we use
fairly frequently.
2018-11-14 12:15:40 +01:00
Fabian Homborg
534f694cee parse_execution: Check array index before using it 2018-11-14 12:15:40 +01:00
Aaron Gyes
7437f82d92 obnam completions: use $hostname instead of (hostname) 2018-11-13 15:49:03 -08:00
Aaron Gyes
920be02fe9 __update_cwd_osc: Use $hostname var instead of hostname command
Changing directories should be a few ms faster.
2018-11-13 15:40:19 -08:00
David Adam
eed274ff78 CHANGELOG: editing for upcoming 3.0
[ci skip]
2018-11-13 22:54:59 +08:00
Mahmoud Al-Qudsi
6dafcc4960 Partially revert 55b3c45 to create pgrp when launched with invalid pgrp
If fish detects that it was started with a pgrp of 0 (which appears to
oddly be the case when run under firejail), create new process group for
fish and give it control of the terminal.

This selectively reverts 55b3c45 in cases where an invalid pgrp is
detected. Note that this is known to cause problems in other cases, such
as #3805 and Microsoft/WSL#1653, although the former may have been
ameliorated or even addressed by the recent job control overhaul, so
that's why we are careful to only assign fish to its own pgroup if an
invalid pgroup was detected and not as the normal case.
2018-11-13 15:00:52 +01:00
David Adam
ae581c7dbc fix tests
Broken in 5bd0472682.
2018-11-13 21:54:41 +08:00
David Adam
5bd0472682 abbr: tidy description 2018-11-13 21:42:49 +08:00
Fabian Homborg
7257c69979 completions/string: Add escaping styles 2018-11-12 18:56:11 +01:00
Fabian Homborg
7a20e8d64d completions/busctl: Port to argparse
This is much faster!
2018-11-12 18:53:30 +01:00
Fabian Homborg
2d2f7c8fb1 completions/ip: Restyle
Just run `fish_indent` on the entire thing.
2018-11-12 16:28:24 +01:00
Fabian Homborg
15f089897d completions/ip: Add basic ip link set completions 2018-11-12 16:22:43 +01:00
David Adam
322b232fc0 Clarify and improve read documentation 2018-11-12 23:13:41 +08:00
David Adam
8e5b1f9e4d docs: drop reference to process expansion 2018-11-12 23:13:41 +08:00
David Adam
4b28e9d2e4 read: update completions to include --lines and --null
Does not include --all-lines pending discussion in #5332.
2018-11-12 23:13:41 +08:00
David Adam
7abfd1db30 fish.spec: drop hostname dependency 2018-11-12 21:46:08 +08:00
ridiculousfish
121991b98c Revert "Convert job list to a dequeue"
This reverts commit 54050bd4c5.

Type job_list_t was changed from a list to a deque in
commit 54050bd4c5.

In process_clean_after_marking(), we remove jobs while iterating.
dequeues do not support that. Make it a list again.
2018-11-11 16:57:30 -08:00
ridiculousfish
6f46eaaeeb Revert "Fix a stale comment"
This reverts commit efa9553dc1.

The comment was not stale.
2018-11-11 16:56:49 -08:00
ridiculousfish
efa9553dc1 Fix a stale comment 2018-11-11 16:08:45 -08:00
ridiculousfish
aa6be9bee4 Pass the original string into wildcard's decsription function
wildcard_complete was invoking the description function with some fragment
of the wildcard string. Instead pass in the original string.

Fixes #5327
2018-11-11 14:15:45 -08:00
Mahmoud Al-Qudsi
d6ab3db159 fixup! Extend __fish_complete_suffix to support a virtual $PWD 2018-11-08 16:17:56 -06:00
Fabian Homborg
77229effb5 expand: Fix get_home_directory_name
This fixes the `~floam/` case, where the out_tail_idx pointer needs to
point to the "/", not the last letter.

The `~/` and `~floam` cases still work.

Unfortunately, I'm unsure of how to test this.

Fixes #5325.
2018-11-08 10:07:45 +01:00
Mahmoud Al-Qudsi
34440165aa Add completions for openocd 2018-11-07 20:08:16 -06:00
Mahmoud Al-Qudsi
da6937e0cf Extend __fish_complete_suffix to support a virtual $PWD
In writing the completion script for openocd I found the need to
complete paths at the command-line as if they were relative to a
path other than the current $PWD. Given that `$PWD` is currently
global in fish (i.e. no side-effect free `cd` within a subshell)
this is probably good to have for other completions too.

This also fixes a bug in support for explicitly supplying the
description for completions via a `$argv` parameter, which prefixed
the description with `\t` (which is correct) except it did so in
the local scope within an `if` statement, meaning the changes never
had any effect and in the output the description was directly
concatenated to the completions, instead of separated by a tab.
2018-11-07 20:08:16 -06:00
Mahmoud Al-Qudsi
6b7501d715 Correct pandoc data directory path in completions
Incorrectly assumed that pandoc uses XDG_CONFIG_HOME, it turns out the
path is hard-coded as $HOME/.pandoc unless explicitly otherwise
specified in the command-line.
2018-11-07 18:34:50 +00:00
Fabian Homborg
460bc00698 Fix string escape var and url styles
Turns out I broke these in my zeal to remove wcs2string.

This reverts commit 583d771b10.

Fixes #5322.
2018-11-07 12:48:11 +01:00
ridiculousfish
bfd50863b8 Correct fish_wcstod and fix Linux build failure
Limit the fish_wcstod fast path to ASCII digits only, to fix the problem
observed in the discussion for a700acadfa
where LANG=de_DE.UTF-8 would cause `test` to interpret commas instead of
periods inside floating point values.
2018-11-06 23:17:41 -08:00
Aaron Gyes
db1500bfa4
Update CHANGELOG.md
Mention that dim/italics were made to work on macOS (ancient ncurses).
2018-11-06 14:09:26 -08:00
Fabian Homborg
4d4227e57f completions/git: Match files inside directories again
Fixes #5317.
2018-11-05 15:53:06 +01:00
ridiculousfish
a700acadfa Implement fish_wcstod and adopt it in builtin_test
wcstod_l is enormously slow on the Mac. This makes arithmetic comparisons
using builtin_test about 250% as fast on macOS.
2018-11-04 20:28:10 -08:00
Mahmoud Al-Qudsi
8ebf2b8f70 Improve pandoc completions
* Only suggest PDF engines that are currently installed
* Use XDG_CONFIG_HOME (after a fashion)
* Initialize lists as arrays instead of blind strings
2018-11-04 20:49:57 -06:00
Mahmoud Al-Qudsi
ffb4ab5ca8 Prevent pandoc completions from polluting global namespace 2018-11-04 20:38:59 -06:00
Mahmoud Al-Qudsi
11b0b23587 Add git remote remove completions 2018-11-04 14:36:51 -06:00
Fabian Homborg
a7ec158373 env: Use preexisting_flags to determine pathiness
We've already checked if the variable exists above, and we've already
gotten the preexisting_flags, so we can just use them.

Saves a lookup.
2018-11-04 17:05:22 +01:00
Moritz Wilhelmy
9afc4b419e Allow cd . to re-enter the current directory
Closes #4543.
2018-11-04 21:46:24 +08:00
David Sanson
7926b69d15 Add completions for pandoc
Taken from https://github.com/dsanson/fish-completion-pandoc under the
GNU GPL as at 7195da6fc4bcbdd49ea63d47c27e4bfec2135660.

Closes #2937.
2018-11-04 21:22:58 +08:00
David Adam
4f3786f8d0 Build system: add extra sysconf directories
Closes #5235.
2018-11-04 21:14:06 +08:00
ridiculousfish
c2ffd3008a Merge branch 'remove_static_stacks'
This merges a stack that removes the WAIT_BY_PROCESS and NESTED job flags.
Instead jobs are taught about their parents, and parents are interrogated to
determine whether they are fully constructed, and therefore whether it is
safe to call waitpid().
2018-11-04 02:00:08 -08:00
ridiculousfish
73537fc7c3 Remove NESTED and WAIT_BY_PROCESS
Now jobs are aware of their parent jobs, and can interrogate those jobs,
to determine if every job in the chain is fully constructed.
Remove flags and the static stacks that manipulated them.
2018-11-04 01:52:17 -08:00
ridiculousfish
30990e8069 Replace WAIT_BY_PROCESS with a parent job check
Instead of manipulating the WAIT_BY_PROCESS flag, have each job interrogate
its "parent chain" to decide if it is safe to waitpid() on its pgid.
2018-11-04 01:51:21 -08:00
ridiculousfish
3770d9fb7a Teach each job about its parent
The parent of a job is the parent pipeline that executed the function or
block corresponding to this job. This will help simplify
process_mark_finished_children().
2018-11-04 01:40:07 -08:00
ridiculousfish
93aa95d8c4 Remove proc_last_bg_pid
It wasn't used.
2018-11-03 19:28:16 -07:00
ridiculousfish
0373a87867 Remove shell_pgid from process_mark_finished_children
It was unused.
2018-11-03 19:19:52 -07:00
ridiculousfish
182d7ce732 Teach cd completions about logical paths
Prior to this fix, cding into a symlink and then completing .. would complete
from the physical directory instead of the logical directory, which could not
actually be cd'd to. Teach cd completiond to use the logical directory.
2018-11-03 13:30:55 -07:00
ridiculousfish
cf01694def Migrate token_infos inside token_for_string and reformat 2018-11-03 12:16:56 -07:00
Fabian Homborg
e1c0ab8edb test: Switch to std::map
Massively improves the time to lookup the token type.

This speeds up `test 1 = 1` by ~8%.
2018-11-03 19:58:51 +01:00