Commit Graph

7085 Commits

Author SHA1 Message Date
Kurtis Rader
16816a1202 add string replace --filter flag
Fixes #3348
2017-05-01 22:07:30 -07:00
Kurtis Rader
48d5342601 style cleanups
Time for another `make style-all`.
2017-05-01 22:05:35 -07:00
David Adam
46d86766c4 README.md: drop which requirement
No longer required following merge of #3945.
2017-05-02 09:26:52 +08:00
Kurtis Rader
6b1c939b67 rename --metadata to --details
Discussion in issue #3295 resulted in a decisions to rename the
functions --metadata flag to --details.

This also fixes a bug in the definition of the short flags for the
`functions` command. The `-e` flag does not take an argument and
therefore should not be defined as `e:`. Notice that the long form,
`--erase`, specifies `no_argument`. This discrepency happened to work
due to a quirk of how the flag parsing loop was written.
2017-04-30 20:21:40 -07:00
Kurtis Rader
65c762f1e1 fix parser error message
Fixes #4000
2017-04-29 21:33:50 -07:00
David Adam
4fde67fa50 implement disown builtin
Closes #2810.

The syntax mirrors that of zsh.
2017-04-29 19:20:03 +08:00
David Adam
f52708a20f job_t: use the sentinel value of -2 for new job process group IDs
0 is not a good default PGID, because it's possible for a kernel process
to have the PGID of 0 under Linux.

This meant that job_get_from_pid could return incorrect jobs, as the PGID
for internal, non-forked jobs was the same as kernel processes.

Avoid this by using an invalid PGID as the initial PGID.
2017-04-29 19:20:03 +08:00
David Adam
16931f724b job_signal: confirm process group before signalling it
It is possible for fish to not be the process group leader; avoid
signalling the process group containing the current process by checking
with getpgrp() rather than assuming that getpid() is enough.
2017-04-29 19:20:03 +08:00
David Adam
8f77b1cdd2 use current PGID (not PID) for new processes when job control is off
If fish is not the first process in a pipeline, and jobs are started
from the fish process, it is possible for fish and the OS to have
different ideas about what the process group of the jobs are.

This change confirms the current PGID, rather than assuming that it is
the same as the PID.
2017-04-29 19:20:03 +08:00
David Adam
10e64fd548 job_get_from_pid: don't assume pgid == pid
Compare apples with apples by using getpgid() when checking a process
against the job list.
2017-04-29 19:20:03 +08:00
David Adam
d32e7f5ad7 job_get_from_pid: use canonical pid_t type 2017-04-29 19:20:03 +08:00
David Adam
8612ac592d add comments documenting use of negative IDs for PGIDs in events 2017-04-29 19:20:03 +08:00
David Adam
b8bf567514 postfork: correct terminology from parent group to process group 2017-04-29 19:20:03 +08:00
David Adam
c32032757e builtin.cpp: update template builtin function 2017-04-29 19:20:03 +08:00
Andreas Nordal
1cb69e6f5c Fix msgid typo from commit 08d42a0507 2017-04-28 17:39:52 -07:00
Fabian Homborg
f5fac096c0 Don't move cursor in delete-char
Instead, move forward and backward in vi-mode.

Fixes #3899.
2017-04-28 22:53:03 +08:00
Andrei Dziahel
a26419557f fixes identical code in both if branches introduced in e52a04e34 2017-04-26 20:30:36 -07:00
Marc Garcia Sastre
980af4aa5b status returns the function name when called with -u parameter
Fixes #1743
2017-04-26 20:15:45 -07:00
David Bishop
2565c5c15b Use $suffix in classic_vcs prompt instead of hardcoding to '>'
Also, ensure that suffix is local in both classic_vcs.fish and informative_vcs.fish.

Fixes #3991
2017-04-26 16:01:52 -07:00
Kurtis Rader
5604bb238e fix make test_high_level so it works 2017-04-25 21:18:14 -07:00
Kurtis Rader
a1d5a19e24 fix string man page
Fixes #3987
2017-04-25 08:48:00 -07:00
Fabian Homborg
77201ade34 __fish_complete_users: Also test for command, not path 2017-04-25 17:36:22 +02:00
Fabian Homborg
49d3a58a9e __fish_complete_users: Use command, not a hardcoded path 2017-04-25 12:47:23 +02:00
Kurtis Rader
937c229b2e eliminate symbol aliases that obscure the code
Defining aliases for existing symbols serves only to obscure the code.
So remove the following symbols and replace them with the primary
symbols:

enum { BUILTIN_TEST_SUCCESS = STATUS_BUILTIN_OK, BUILTIN_TEST_FAIL =
STATUS_BUILTIN_ERROR };

See issue #3985.
2017-04-24 23:06:22 -07:00
Kurtis Rader
5b6814d6ad add string match --filter flag
Fixes #3957
2017-04-24 21:45:06 -07:00
Kurtis Rader
37508d1f1e refactor the __*_users functions
Per my comment in issue #3980 this implements `__fish_print_users` in
terms of `__fish_complete_users` so we don't have to modify both when a
change to how users are enumerated is needed.
2017-04-23 20:08:40 -07:00
Christian Rondeau
bea0b17c9e Aucompletion guards for /etc/passwd #3980 2017-04-23 19:41:07 -07:00
Fabian Homborg
30e02383a5 Identifiers: Fix typo.
Function names can indeed not contain a "/".
2017-04-23 13:46:56 +02:00
Fabian Homborg
ec92e91ddc fish_clipboard_paste: Turn \r into \n
We already do this in bracketed-paste because it's really confusing to
have a \r literal in the commandline.
2017-04-23 13:40:40 +02:00
Fabian Homborg
cc7d83fa94 fish_clipboard_paste: Fix multiline pasting 2017-04-23 13:38:32 +02:00
Fabian Homborg
17ba21cfe4 Fix pasting backslashes
Another missing escape.

Fixes #3981.
2017-04-23 13:32:24 +02:00
Kurtis Rader
f1d40a3c7c limit bind mode names to the rules for var names
The bind mode names can be, and are, used in the construction of fish
variable names. So don't allow users to use names that are not legal as
a variable name. This should not break anything since, AFAICT, no
existing fish scripts, including those provided by Oh-My-Fish and
Fisherman define bind modes that would not be legal with this change.

Fixes #3965
2017-04-22 20:33:56 -07:00
Kurtis Rader
275d658616 simplify and clarify valid identifiers
This is the first step in addressing issue #3965. It renames some of the
functions involved in validating variable and function names to clarify
their purpose. It also augments the documentation to make the rules for
such identifiers clearly documented.
2017-04-21 21:55:06 -07:00
Kurtis Rader
15e1f4349b document [alt-enter] behavior in funced command
Fixes #893
2017-04-21 17:15:56 -07:00
Alex Gaynor
f30c50cec5 [hg completions] remove a grep and use hg's native query syntax
This has the side benefit of working around a wild bug with readline+fish that I've reported to the upstream readline developers. (The result of that bug is that the hg processes are constantly being leaked as `bg` jobs in the shell, which is how I came to notice this in the first place)
2017-04-21 18:56:54 +02:00
Fabian Homborg
805a177673 __fish_config_interactive: Prefer python3
Also includes the CHANGELOG.
2017-04-21 13:45:49 +02:00
Fabian Homborg
e410d47565 fish_config: Pick a python
Also remove a use of `eval` and `string escape`.

Fixes #3970.
2017-04-21 13:45:49 +02:00
Fabian Homborg
7ef2d5e86f fish_update_completions: Pick a python
This removes a need for packagers to either patch our shebangs or pick
a particular python.

This was already done in __fish_config_interactive (where we need to
duplicate the code because it involves backgrounding).

Work towards #3970.
2017-04-21 13:45:49 +02:00
Fabian Homborg
3c95e00e8a It's "single quotes", not "single-quotes" 2017-04-21 13:43:02 +02:00
Kurtis Rader
b9d2e4d897 fix fish greeting regression
Fixes #3973
2017-04-20 20:17:50 -07:00
Fabian Homborg
cb9f4e621f lua completions: Try harder to find libraries
Fedora puts them in /usr/lib64 without having /usr/lib as a symlink.

Also silence errors (in case a directory doesn't exist) and stringify.

See https://bugzilla.redhat.com/show_bug.cgi?id=1442628.

CC @amluto.
2017-04-20 14:00:30 +02:00
Fabian Homborg
7c6600895e Add missing options to functions completion 2017-04-19 23:11:35 +02:00
Fabian Homborg
c0d80ab996 Tighten MANPATH test
This is to fix tests on Travis, since that stores the commit message in an environment variable.

`env | grep MANPATH` of course picks it up and generates unwanted output.

Yes.
2017-04-18 22:42:38 +02:00
Fabian Homborg
ffbda7fe64 Group read changes in CHANGELOG
Also attempt to defeat Travis.
2017-04-18 22:27:32 +02:00
Fabian Homborg
8b201d8077 Update CHANGELOG entry for empty $*PATH components
This was later changed to auto-convert these and expanded to $PATH and $MANPATH as well.
2017-04-18 21:03:13 +02:00
Fabian Homborg
9e2776af0e Changelog $USER changes 2017-04-18 15:13:29 +02:00
Fabian Homborg
3fa5d6c794 Force setting $USER if UID is 0
Works around some weird su implementations.

Fixes #3916.
2017-04-18 15:06:49 +02:00
Kurtis Rader
3ade72266c fix bug I introduced by previous squash merge
When I squash merged to create commit a9db99ac5 I overlooked updating
the unit test.
2017-04-17 21:23:03 -07:00
Francisco Giordano
349eff0df7 change cancel_commandline function to use color from variable
This allows the user to define how they want the "^C" rendered when a
pending command line is interrupted.
2017-04-17 21:16:42 -07:00
Ivan Trubach
a9db99ac52 Rename replace-one to replace_one
Fixes invalid character in variable name $fish_cursor_replace-one (used by fish_vi_cursor[_handle]) by renaming bind mode 'replace-one' to 'replace_one'.
2017-04-17 21:10:23 -07:00