Commit Graph

212 Commits

Author SHA1 Message Date
David Adam
0808e5094b CHANGELOG: work on 3.2.0
Drops the headers for next-minor for now
2021-02-21 10:43:56 +08:00
ridiculousfish
11a373f121 Prevent redirecting internal processes to file descriptors above 2
The user may write for example:

    echo foo >&5

and fish would try to output to file descriptor 5, within the fish process
itself. This has unpredictable effects and isn't useful. Make this an
error.

Note that the reverse is "allowed" but ignored:

    echo foo 5>&1

this conceptually dup2s stdout to fd 5, but since no builtin writes to fd
5 we ignore it.
2021-02-20 16:16:45 -08:00
Ilya Grigoriev
622f2868e1 Fix set -U when fish_variables is a symlink
Previously, `set -U` would overwrite the symlink with a
regular file.

Fixes https://github.com/fish-shell/fish-shell/issues/7466
2021-02-20 14:24:11 -08:00
ridiculousfish
9db51e7156 Relnote fix for 7723 2021-02-17 15:49:55 -08:00
Johannes Altmanninger
7c9da2ce61 CHANGELOG: fix some wrong issue references 2021-02-16 18:39:03 +01:00
David Adam
39dbcef68d CHANGELOG: work on 3.2.0
This commit brings the changelog up-to-date with the 3.2.0 milestone at the
date of commit.
2021-02-16 22:29:48 +08:00
ridiculousfish
c35535dee7 Do not show the history variable in fish_config
The history variable may be so large that it hangs the browser, as
spotted in #7714. Omit this from the variable list.
2021-02-15 10:47:13 -08:00
David Adam
d5ac8a01b6 CHANGELOG: work on 3.2.0 2021-02-13 22:41:11 +08:00
Johannes Altmanninger
5e8a248758 Indent escaped newlines
Similar to what fish_indent does. After typing "echo \" and hitting return,
the cursor will be indented.

A possible annoyance is that when you have multiple indented lines

	echo 1 \
	    2 \
	    3 \
	    4 \

If you remove lines in the middle with Control-k, the lines below
the deleted one will start jumping around, as they are disconnected
from and reconnected to "echo".
2021-02-13 09:01:41 +01:00
Johannes Altmanninger
fffcdf8792 Highlight redirection target as valid if it contains a to-be-defined variable
If a variable is undefined, but it looks like it will be defined by the
current command line, assume the user knows what they are doing.
This should cover most real-world occurrences.

Closes #6654
2021-02-13 08:59:54 +01:00
Johannes Altmanninger
4c1173f2ae fish_clipboard_paste: trim indentation when pasting multiple lines
When pasting a multiline command with indented blocks, extra indentation
from spaces, or tabs, is generally undesirable, because fish already indents
pipes and blocks. Discard the indentation unless the cursor or the pasted
part is inside quotes.

Users who copied fish_clipboard_paste need to update it because
__fish_commandline_is_singlequoted had an API change and was renamed.
2021-02-13 08:55:59 +01:00
Ethel Morgan
5a0aa7824f Saturate exit codes to 255 for all builtins
After commit 6dd6a57c60, 3 remaining
builtins were affected by uint8_t overflow: `exit`, `return`, and
`functions --query`.

This commit:
- Moves the overflow check from `builtin_set_query` to `builtin_run`.
- Removes a conflicting int -> uint8_t conversion in `builtin_return`.
- Adds tests for the 3 remaining affected builtins.
- Simplifies the wording for the documentation for `set --query`.
- Does not change documentation for `functions --query`, because it does
  not state the exit code in its API.
- Updates the CHANGELOG to reflect the change to all builtins.
2021-02-13 08:41:51 +01:00
Johannes Altmanninger
e27d97b02e Do not add spaces after completions ending in "-"
Some programs use this to separate things in a word, see
https://github.com/spf13/cobra/pull/1249#discussion_r563605048

Require the token to be at least length 2 for the no-space behavior,
for completions of "-" like for python.
2021-02-13 08:13:31 +01:00
ridiculousfish
84d59accfc builtins to allow stdin to be closed
Prior to this fix, if stdin were explicitly closed, then builtins would
silently fail. For example:

    count <&-

would just fail with status 1. Remove this limitation and allow each
builtin to handle a closed stdin how it sees fit.
2021-02-10 17:43:10 -08:00
Ethel Morgan
6dd6a57c60 Saturate return value in builtin_set_query
builtin_set_query returns the number of missing variables. Because the
return value passed to the shell is an 8-bit unsigned integer, if the
number of missing variables is a multiple of 256, it would overflow to 0.

This commit saturates the return value at 255 if there are more than 255
missing variables.
2021-02-08 20:38:56 +01:00
Fabian Homborg
42c75111c8 CHANGELOG: Fix code inside bold blocks
Sphinx doesn't like it, so either use normal quotes or put the code
outside of the bold block.
2021-02-08 17:18:53 +01:00
Michael Jarvis
84a89f5195 Fix sphinx warning
[100%] Building HTML documentation with Sphinx
../CHANGELOG.rst:48: WARNING: Document or section may not begin with a transition.
../CHANGELOG.rst:48: WARNING: Document or section may not begin with a transition.
2021-02-08 17:16:40 +01:00
Johannes Altmanninger
e487f193b8 CHANGELOG: add headers for fish-next-minor 2021-02-08 07:31:33 +01:00
Fabian Homborg
48b3b826aa CHANGELOG fish_color_keyword 2021-02-07 21:20:34 +01:00
Mahmoud Al-Qudsi
1651db23fe Update CHANGELOG to add issue 4873 to 3.2.0 release 2021-02-07 10:36:38 -06:00
David Adam
c633ce7e76 CHANGELOG: work on 3.2.0 2021-02-07 22:14:03 +08:00
Shun Sakai
9147a30926 Update CHANGELOG 2021-02-05 12:25:04 +01:00
Shun Sakai
4d48720d6a Update CHANGELOG 2021-02-05 12:24:23 +01:00
Johannes Altmanninger
29ee4d318d Do use autogenerated completions for external git subcommands
Some third party Git tools provide a man page, which we can at least use
for completing options.

The old logic excluded all generated completions for Git subcommands.
Instead, try to load completions for all available external subcommands.
We can use $PATH/git-* because /bin/git-add and friends were removed in Git
1.6.0 in 2008.

Closes #4358 (the "git-foo" wrapping was added in #7652)
2021-02-02 07:54:28 +01:00
Fabian Homborg
b8920d493f CHANGELOG: Add userdbctl completions, put systemd stuff together 2021-01-30 19:03:31 +01:00
Fabian Homborg
261e13e0ca CHANGELOG --profile-startup
See #7648
2021-01-29 20:48:13 +01:00
Fabian Homborg
f78cbf79fc CHANGELOG: Make the important bits bold
Nicked from the old (old old old) changelog for fishfish Beta r1
2021-01-26 14:36:43 +01:00
Johannes Altmanninger
09161761c1 Complete custom "git-foo" commands from "git foo"
Since #7075, git-foo.fish files are sourced when Git completions are loaded.
However, at least Cobra (CLI framework for Go) provides completions like

	complete git-foo ...

This means that completions are only offered when typing "git-foo <TAB>"
and not on "git foo <TAB>". Fix this by forwarding the completion requests.
Take care to only forward if there are actually completions for "git-foo",
to avoid adding filename completions.
2021-01-25 19:09:56 +01:00
Fabian Homborg
2109817861 MOAR CHANGELOG 2021-01-22 16:51:46 +01:00
Fabian Homborg
435021e8c2 CHANGELOG 4: Possibly too much changelog edition
Some reformatting and showing an example for the prompt truncation, mainly
2021-01-21 19:07:38 +01:00
Fabian Homborg
392fb490b0 CHANGELOG 3: Return Of The Changelog 2021-01-20 21:30:50 +01:00
Fabian Homborg
7265d3763f CHANGELOG: Even moar 2021-01-20 19:53:53 +01:00
Fabian Homborg
5d8761dc31 CHANGELOG: Work on 3.2.0 2021-01-20 17:57:09 +01:00
Fabian Homborg
c5379aaf2d CHANGELOG Add 7638 2021-01-19 19:02:58 +01:00
Fabian Homborg
89962da059 CHANGELOG: More 3.2.0 2021-01-19 13:45:00 +01:00
David Adam
d0167634e7 CHANGELOG: work on 3.2.0 2021-01-13 21:52:31 +08:00
ridiculousfish
7a0bddfcfa Teach string repeat to handle multiple arguments
Each argument in string repeat is handled independently, except that the
--no-newline option applies only to the last newline.

Fixes #5988
2021-01-11 17:00:06 -08:00
Fabian Homborg
19efd22468 env: Setup $HOME/$USER *before* the config directories
They are based on $HOME, so setting $HOME has to be done first.

Fixes #7620

(untested because I'm assuming common CI systems have weird $HOME settings)
2021-01-11 18:51:47 +01:00
Fabian Homborg
f22fe44c79 CHANGELOG 7614 2021-01-09 12:13:24 +01:00
Fabian Homborg
bc2612da18 CHANGELOG: Some more work of un-issued commits
We should really start just adding these to the changelog sooner.
2021-01-08 18:34:49 +01:00
David Adam
6d1eab9364 CHANGELOG: fix some Markdown to reStructuredText nits 2021-01-08 22:22:43 +08:00
David Adam
9af5b33a6d CHANGELOG: work on 3.2.0 2021-01-08 22:12:13 +08:00
David Adam
21f46181d9 string match: reword the named capture group documentation 2021-01-08 21:16:07 +08:00
David Adam
fb873f2e98 CHANGELOG: work on 3.2.0 2021-01-07 22:17:04 +08:00
Fabian Homborg
cb3ee51e08 CHANGELOG cgi removal 2021-01-03 15:18:15 +01:00
Ilan Cosman
18940ea086
Remove dunderscores from __fish_status_to_signal (#7597)
* Remove dunderscores from __fish_status_to_signal

* Document fish_status_to_signal

* CHANGELOG: Add fish_status_to_signal

* Add string join to fish_status_to_signal documentation example
2021-01-03 15:15:57 +01:00
ridiculousfish
29121ffc4c Relnote fixes for #7589 and #1383 2021-01-02 22:18:14 -08:00
David Adam
ab5608ddf2 CHANGELOG: work on 3.2.0 2021-01-02 23:26:58 +08:00
Fabian Homborg
eb43fc83c5 CHANGELOG: Add that numbered debugging is no more 2021-01-01 20:47:23 +01:00
Fabian Homborg
8a585bb711 Also disable winch handling in alacritty
It also reflows.

We might want to think about doing something more extensible here, as
konsole is also about to add reflow, but for now the main problem
children here are VTE and alacritty.

Extends #7491.
2021-01-01 20:22:57 +01:00
Fabian Homborg
364692fa3d CHANGELOG: MOAR 2021-01-01 18:38:20 +01:00
Johannes Altmanninger
9231956f62 CHANGELOG: document some changes with no associated issue
This should cover my remaining user-facing commits since 3.1.2.
2021-01-01 12:20:37 +01:00
Fabian Homborg
5c09a6d91e CHANGELOG: Missed one ayu colorscheme
*Ozzy voice* I'm going through CHANGELOGs
2021-01-01 12:19:12 +01:00
Fabian Homborg
8ffa440936 More CHANGELOG
Changelog, dub dub dub CHANGELOG, dibbie dab dab CHANGELOG
2021-01-01 11:39:41 +01:00
ridiculousfish
66c2266ed1 Correct a changelog 'issue' template to remove the hash
This fixes an 'Invalid issue number' warning.
2020-12-31 16:34:04 -08:00
David Adam
bdb99168f0 CHANGELOG: work on 3.2.0 2020-12-31 22:06:25 +08:00
ridiculousfish
43505f7077 Allow ** glob segments to match zero directories
Prior to this change, a glob like `**/file.txt` would only match
`file.txt` in subdirectories; the `**` must match at least one directory.
This is historical behavior.

With this change we move a little closer to bash's implementation by
allowing a literal `**` segment to match in the current directory. That
is, `**/foo` will match both `foo` and `bar/foo`, while `b**/foo` will
only match `bar/foo`.

Fixes #7222.
2020-12-28 23:51:18 -08:00
Ilan Cosman
94d18c1ac5 CHANGELOG: Add missing --query 2020-12-26 23:18:14 +01:00
ridiculousfish
315f8f8a83 Relnote ldapsearch completions
[ci skip]
2020-12-26 12:16:46 -08:00
Fabian Homborg
a6674483c1 CHANGELOG: Add more issues to 3.2
Importantly I had added some of the `math` things to 3.1 by accident,
this movs them to 3.2
2020-12-26 19:36:24 +01:00
Johannes Altmanninger
bae75c96d9 __fish_complete_suffix: complete all files, but sort files with matching suffix first
See #7040 and others.
2020-12-23 19:14:10 +01:00
Shun Sakai
58d9fa3820 Add completions for .NET 2020-12-19 16:55:24 -08:00
ridiculousfish
f61f45748e Document insert-line-under and insert-line-over bindings 2020-12-19 14:32:17 -08:00
Fabian Homborg
39263fc92d Some refinemens to the CHANGELOG
Remove some bits from the significant changes, add some others, expand
on some points.

[ci skip]
2020-12-16 17:38:26 +01:00
ridiculousfish
36766ea3d7 Correct $status for certain pipeline-aborting failures
If we refused to launch a job because of a "pipeline aborting" error,
then it's the caller's responsibility to set $status.

Fixes #7540
2020-12-13 17:33:34 -08:00
ridiculousfish
a2e486966a Always become pgroup leader in interactive mode
Prior to this change, if fish were launched connected to a tty but not as
pgroup leader, it would attempt to become pgroup leader only if
--interactive is explicitly passed. But bash will unconditionally attempt
to become pgroup leader if launched interactively. This can result in
scenarios where fish is running interactively but in another pgroup. The
most obvious impact is that control-C will result in the pgroup leader
(not fish) exiting and make fish orphaned.

Switch to matching the bash behavior here - we will always try to become
pgroup leader if interactive.

Fixes #7060.
2020-12-06 13:42:35 -08:00
Fabian Homborg
3d0200a115 CHANGELOG: string is now a reserved word
and can't be used for functions.
2020-12-06 15:40:46 +01:00
ridiculousfish
8a29fa6778 Relnote fix for expansion limits 2020-12-05 13:23:23 -08:00
Fabian Homborg
f6da895df4 CHANGELOG: Webconfig theme 2020-12-04 17:08:45 +01:00
Fabian Homborg
44eadd8bed CHANGELOG: Add some of the recent work 2020-12-04 17:02:59 +01:00
ridiculousfish
2b8d2deb0c Introduces "smartcase" completions
"smartcase" performs case-insensitive matching if the input string is all
lowercase, and case-sensitive matching otherwise. When completing e.g.
files, we will now show both case sensitive and insensitive completions if
the input string does not contain uppercase characters.

This is a delicate fix in an interactive component with low test coverage.
It's likely something will regress here.

Fixes #3978
2020-11-29 12:40:01 -08:00
ridiculousfish
639cd66ba1 Conditionally make autosuggestions case sensitive
When fish presents an autosuggestion, there is some logic around whether
to retain it or discard it as the user types "into" it. Prior to this
change, we would retain the autosuggestion if the user's input text is a
case-insensitive prefix of the autosuggestion. This is reasonable for
certain case-insensitive autosuggestions like files, but it is confusing
especially for history items, e.g. `git branch -d ...` and `git branch -D
...` should not be considered a match.

With this change, when we compute the autosuggestion we record whether it
is "icase", and that controls whether the autosuggestion permits a
case-insensitive extension.

This addresses part of #3978.
2020-11-29 12:35:18 -08:00
Fabian Homborg
9bcfa851c1 CHANGELOG math --base
[ci skip]
2020-11-27 19:50:04 +01:00
Fabian Homborg
7e9b1f871b CHANGELOG: Use :issue: role
[ci skip]
2020-11-27 19:48:58 +01:00
Mahmoud Al-Qudsi
962ff26b92 Add named capture groups to changelog 2020-11-26 14:41:31 -06:00
ridiculousfish
1d2dd3975a Add fix for #7483 to changelog 2020-11-23 19:38:03 -08:00
Fabian Homborg
9b3f4faa5a CHANGELOG: Use :issue: role 2020-11-22 16:47:44 +01:00
Shun Sakai
36337fc45d Add completions for julia 2020-11-09 00:41:38 +09:00
Fabian Homborg
638cf61407 CHANGELOG cancel-undo 2020-10-30 19:37:44 +01:00
Fabian Homborg
6aa4f6b5ca CHANGELOG: Reorganize a bit
The builtin-buffering thing is huge and should be early in the big
ticket items, the performance improvement to completion of commands is
cool but not all that important.

[ci skip]
2020-10-28 20:13:58 +01:00
Johannes Altmanninger
943cf03d8e Only send the PID of the last process in a job to builtin fg
jobs -p %1 prints all processes in the first job.
fg is special because it only takes one argument.  Using the last process
in the pipeline works for the cases I can think of.

Fixes #7406
2020-10-18 19:36:48 +02:00
Johannes Altmanninger
863b4700f8 Use builtin command in spago completions, add to changelog 2020-10-10 13:11:53 +02:00
Johannes Altmanninger
f20e8e5860 alias: don't add --wraps for wrappers with the same name
These aliases seem to be common, see #7389 and others.  This prevents
recursion on that example, so `alias ssh "env TERM=screen ssh"` will just
have the same completions as ssh.

Checking the last token is a heuristic which hopefully works for most
cases. Users are encouraged to use functions instead of aliases.
2020-10-10 09:24:49 +02:00
David Adam
9292e2fd56 CHANGELOG: work on 3.2.0
[ci skip]
2020-10-07 21:23:44 +08:00
David Adam
04cb23a038 CHANGELOG: work on 3.2.0
[ci skip]
2020-10-06 22:53:58 +08:00
David Adam
3a59958f98 CHANGELOG: work on 3.2.0
[ci skip]
2020-10-05 22:38:31 +08:00
David Adam
68455f2d46 CHANGELOG: note that stderr-nocaret will be default in future
Work on #7105.
2020-10-05 21:12:51 +08:00
Fabian Homborg
52926fb576 More CHANGELOG work for 3.2.0 2020-10-04 14:47:17 +02:00
Fabian Homborg
83b6098827 CHANGELOG
A better example for the builtin buffering and a plurality
thinko ("the docs are", "the documentation is").

[ci skip]
2020-10-04 14:23:57 +02:00
Fabian Homborg
68fb1d9883 CHANGELOG New doc theme
[ci skip]
2020-10-04 11:07:30 +02:00
Fabian Homborg
bbdfe126a7 Flash if history search found nothing
This makes it clearer that we're at the end.

Fixes #7362.
2020-09-30 18:02:22 +02:00
David Adam
b1818270f9 CHANGELOG: work on 3.2.0
[ci skip]
2020-09-28 22:48:21 +08:00
Johannes Altmanninger
f758d39535 string pad: handle padding characters of width > 1
If the padding is not divisible by the char's width without remainder,
we pad the remainder with spaces, so the total width of the output is correct.

Also add completions, changelog entry, adjust documentation, add examples
with emoji and some tests.  Apply some minor style nitpicks and avoid extra
allocations of the input strings.
2020-09-27 21:59:15 +02:00
David Adam
9f1fc6d040 CHANGELOG: work on 3.2.0
[ci skip]
2020-09-27 22:37:18 +08:00
David Adam
73173dce7a CHANGELOG: work on 3.2.0
[ci skip]
2020-09-27 10:54:15 +08:00
Fabian Homborg
d636918795 Fix warnings in CHANGELOG
../CHANGELOG.rst:30: WARNING: Bullet list ends without a blank line; unexpected unindent.
../CHANGELOG.rst:117: WARNING: Inline literal start-string without end-string.

[ci skip]
2020-09-24 21:03:47 +02:00
David Adam
4cb9f3224c CHANGELOG: work on 3.2.0
[ci skip]
2020-09-24 22:50:57 +08:00
Fabian Homborg
1da56f9937 Make history search smartcase
This makes history searches case-insensitive, unless the search string
contains an uppercase character.

This is what vim calls "smartcase".

Fixes #7273.
2020-09-22 16:13:24 +02:00
Fabian Homborg
c7b51b360d CHANGELOG
[ci skip]
2020-09-21 21:01:44 +02:00
Fabian Homborg
21077c0c9a CHANGELOG A few rewordings
[ci skip]
2020-09-18 22:18:03 +02:00