Commit Graph

706 Commits

Author SHA1 Message Date
David Adam
80394ea4e3 Release 3.7.1 2024-03-19 11:40:45 +08:00
David Adam
445fba4464 CHANGELOG: work on 3.7.1 2024-03-18 22:53:13 +08:00
David Adam
98662ae076 CHANGELOG: work on 3.7.1 2024-03-18 22:26:49 +08:00
Johannes Altmanninger
bc246d87b2 Add closed issues and PRs to 3.8 changelog
I used below script to list all GitHub issues and PRs that are not yet
mentioned in the changelog. It's almost empty now.

While at it, curate the "notable" section and move some entries around,
notably from "interactive improvements"  to "bindings".

```shell
ms="fish next-3.x"
{
    gh issue list --state closed --milestone "$ms" -L 500
    gh pr list --state all --search "milestone:\"$ms\"" -L 500
} | sort -n | while IFS='
' read line; do
    set -- $line
    grep -qE '\W'$1 CHANGELOG.rst ||
    echo https://github.com/fish-shell/fish-shell/issues/$1 "$line"
done
```
2024-03-17 11:41:32 +01:00
Johannes Altmanninger
068f92ce7e Changelog update 2024-03-16 10:31:01 +01:00
Fabian Boehm
9b9cfc207f CHANGELOG for 3.7.1 2024-03-13 18:24:01 +01:00
Johannes Altmanninger
d8d491741b edit_command_buffer: preserve external editor's cursor position
Unless the editor changed to a different file for some reason.

Note that the Kakoune integration uses -always to export the cursor even if
the user temporarily suppressed hooks - possibly a "fish_indent" hook.
2024-03-10 11:08:12 +01:00
Fabian Boehm
f60b6e6cd4 CHANGELOG 2024-02-27 16:28:20 +01:00
Fabian Boehm
8712bd5a4b CHANGELOG terminfo 2024-02-22 20:15:24 +01:00
Johannes Altmanninger
0627c9d9af Render control characters as Unicode Control Pictures
Inserting Tab or Backspace characters causes weird glitches. Sometimes it's
useful to paste tabs as part of a code block.

Render tabs as "␉" and so on for other ASCII control characters, see
https://unicode-table.com/en/blocks/control-pictures/. This fixes the
width-related glitches.

You can see it in action by inserting some control characters into the
command line:

	set chars
	for x in (seq 1 0x1F)
		set -a chars (printf "%02x\\\\x%02x" $x $x)
	end
	eval set chars $chars
	commandline -i "echo '" $chars

Fixes #6923
Fixes #5274
Closes #7295

We could extend this approach to display a fallback symbol for every unknown
nonprintable character, not just ASCII control characters.

In future we might want to support tab properly.
2024-02-15 01:39:45 +01:00
Henrik Hørlück Berg
59fa7479ee
Add documentation and release notes for #10282 2024-02-11 12:43:13 +01:00
Johannes Altmanninger
47aa79813d Open command script in external editor on Alt+o
Fish functions are great for configuring fish but they don't integrate
seamlessly with the rest of the system. For tasks that can run outside fish,
writing scripts is the natural approach.

To edit my scripts I frequently run

    $EDITOR (which my-script)

Would be great to reduce the amount typing for this common case (the names
of editor and scripts are usually short, so that's a lot of typing spent on
the boring part).

Our Alt+o binding opens the file at the cursor in a pager.  When the cursor
is in command position, it doesn't do anything (unless the command is actually
a valid file path). Let's make it open the resolved file path in an editor.

In future, we should teach this binding to delegate to "funced" upon seeing
a function instead of a script. I didn't do it yet because funced prints
messages, so it will mess with the commandline rendering if used from
a binding.  (The fact that funced encourages overwriting functions that
ship with fish is worrysome. Also I'm not sure why funced doesn't open the
function's source file directly (if not sourced from stdin). Persisting the
function should probably be the default.)

Alternative approach: I think other shells expand "=my-script" to
"/path/to/my-script".  That is certainly an option -- if we do that we'd want
to teach fish to complete command names after "=".  Since I don't remember
scenarios where I care about the full path of a script beyond opening it in
my editor, I didn't look further into this.

Closes #10266
2024-02-07 00:07:47 +01:00
Fabian Boehm
ea5adcac9d CHANGELOG: Work on next release
Including some preliminary bits on packaging.
2024-02-04 09:47:21 +01:00
Johannes Altmanninger
b768b9d3f5 Use fuzzy subsequence completion for options names as well
Version 2.1.0 introduced subsequence matching for completions but as the
changelog entry mentions, "This feature [...] is not yet implemented for
options (like ``--foobar``)".  Add it. Seems like a strict improvement,
pretty much.
2024-01-27 17:57:48 +01:00
Johannes Altmanninger
368017905e builtin commandline: -x for expanded tokens, supplanting -o
Issue #10194 reports Cobra completions do

    set -l args (commandline -opc)
    eval $args[1] __complete $args[2..] (commandline -ct | string escape)

The intent behind "eval" is to expand variables and tildes in "$args".
Fair enough. Several of our own completions do the same, see the next commit.

The problem with "commandline -o" + "eval" is that the former already
removes quotes that are  relevant for "eval". This becomes a problem if $args
contains quoted () or {}, for example this command will wrongly execute a
command substituion:

    git --work-tree='(launch-missiles)' <TAB>

It is possible to escape the string the tokens before running eval, but
then there will be no expansion of variables etc.  The problem is that
"commandline -o" only unescapes tokens so they end up in a weird state
somewhere in-between what the user typed and the expanded version.

Remove the need for "eval" by introducing "commandline -x" which expands
things like variables and braces. This enables custom completion scripts to
be aware of shell variables without eval, see the added test for completions
to "make -C $var/some/dir ".

This means that essentially all third party scripts should migrate from
"commandline -o" to "commandline -x". For example

    set -l tokens
    if commandline -x >/dev/null 2>&1
        set tokens (commandline -xpc)
    else
        set tokens (commandline -opc)
    end

Since this is mainly used for completions, the expansion skips command
substitutions.  They are passed through as-is (instead of cancelling or
expanding to nothing) to make custom completion scripts work reasonably well
in the common case. Of course there are cases where we would want to expand
command substitutions here, so I'm not sure.
2024-01-27 09:28:06 +01:00
Fabian Boehm
b8b062eb84 docs: Update qmark-noglob status
Note: The version number needs to be adjusted
2024-01-25 18:47:41 +01:00
Johannes Altmanninger
5dfcfa336b edit_command_buffer: if aliasee is a recognized editor, pass cursor position too
If I alias "e" to "emacsclient" it will probably accept the same options.
Let's dereference the alias so we can detect support for passing the cursor
position in more cases.

This does not solve the problem for recursive cases (e.g. alias of another
alias). If we want to handle that we would need cycle detection.
2024-01-21 09:39:59 +01:00
Johannes Altmanninger
fff8e8163b Control-C to simply clear commandline buffer again
Commit 5f849d0 changed control-C to print an inverted ^C and then a newline.

The original motivation was

> In bash if you type something and press ctrl-c then the content of the line
> is preserved and the cursor is moved to a new line. In fish the ctrl-c just
> clears the line. For me the behaviour of bash is a bit better, because it
> allows me to type something then press ctrl-c and I have the typed string
> in the log for further reference.

This sounds like a valid use case in some scenarios but I think that most
abandoned commands are noise. After all, the user erased them. Also, now that
we have undo that can be used to get back a limited set of canceled commands.

I believe the original motivation for existing behavior (in other shells) was
that TERM=dumb does not support erasing characters. Similarly, other shells
like to leave behind other artifacts, for example when using tab-completion
or in their interactive menus but we generally don't.

Control-C is the obvious way to quickly clear a multi-line commandline.
IPython does the same. For the other behavior we have Alt-# although that's
probably not very well-known.

Restore the old Control-C behavior of simply clearing the command line.

Our unused __fish_cancel_commandline still prints the ^C. For folks who
have explicitly bound ^C to that, it's probably better to keep the existing
behavior, so let's leave this one.

Previous attempt at #4713 fizzled.

Closes #10213
2024-01-17 19:54:57 +01:00
Fabian Boehm
4286b049ca docs: Fix two formatting errors
sphinx *really* needs an empty line after a `::` code block starter
2024-01-05 16:49:49 +01:00
David Adam
1b6374d2ce Merge branch 'Integration_3.7.0' 2024-01-02 00:08:49 +08:00
David Adam
0e4d088b11 Release 3.7.0 2024-01-01 23:15:17 +08:00
David Adam
be0ea9862c CHANGELOG: work on 3.7.0 2024-01-01 22:01:45 +08:00
Fabian Boehm
d6833edf54 CHANGELOG 2024-01-01 00:14:26 +01:00
Fabian Boehm
5c532ace5a CHANGELOG umask fix 2023-12-31 19:40:18 +01:00
David Adam
8a447355a2 CHANGELOG: work on 3.7.0 2023-12-31 22:37:18 +08:00
David Adam
8508cc50b0 CHANGELOG: work on 3.7.0 2023-12-31 13:07:02 +08:00
ridiculousfish
b28eae8be9 Allow custom completions to have leading dots
By default, fish does not complete files that have leading dots, unless the
wildcard itself has a leading dot. However this also affected completions;
for example `git add` would not offer `.gitlab-ci.yml` because it has a
leading dot.

Relax this for custom completions. Default file expansion still
suppresses leading dots, but now custom completions can create
leading-dot completions and they will be offered.

Fixes #3707.

(cherry picked from commit b7de768c73)
2023-12-31 09:55:09 +08:00
David Adam
f6676350a7 CHANGELOG: work on 3.7.0 2023-12-31 09:53:20 +08:00
Amy Grace
36ed2b79c2 completions: add xxd
Closes #10137
2023-12-30 10:18:30 +01:00
tangowithfoxtrot
7370e38069 add completions for bws
Closes #10165
2023-12-30 09:31:33 +01:00
David Adam
ba57704276 CHANGELOG: work on 3.7.0 2023-12-29 23:56:46 +08:00
David Adam
c02cb3b260 CHANGELOG: work on 3.8.0 2023-12-29 23:48:44 +08:00
ridiculousfish
534c00bdbf Changelog fix for #10168 2023-12-28 13:38:01 -08:00
Christian Fersch
7008e0eec2 git completion: Handle aliases referencing other aliases (#9992)
(cherry picked from commit 1980a22522)
2023-12-28 11:06:04 +08:00
David Adam
6f7d5f427b CHANGELOG: work on 3.8.0 2023-12-27 22:59:24 +08:00
David Adam
8707c05b7b CHANGELOG: work on 3.7.0 2023-12-27 22:58:33 +08:00
David Adam
ecf8ac6f66 CHANGELOG: work on 3.7.0 2023-12-26 23:24:00 +08:00
Shou Ya
b44bdea230 Enable globbing in history-pager
The existing subsequence search commonly returns false positives.
Support globs, to allow searching for disconnected substrings in a better way.

Closes #10143
Closes #10131
2023-12-24 09:08:03 +01:00
David Adam
b12c36e72d CHANGELOG: work on 3.7.0 2023-12-23 23:24:45 +08:00
David Adam
60777f99b4 CHANGELOG: update current branch to aim for 3.8.0 2023-12-23 23:20:34 +08:00
David Adam
446a41e23a CHANGELOG: work on 3.7.0 2023-12-20 00:23:45 +08:00
Quinten Roets
95c3a4045b fish_vi_cursor: add new variable for external cursor mode (#9565)
* add new variable for external cursor mode

* fix backwards compatibility

* add documentation

* document change in changelog

(cherry picked from commit f5506803d7)
2023-12-20 00:06:56 +08:00
David Adam
313b2993f5 Merge branch 'Integration_3.6.4' into Integration_3.7.0 2023-12-08 11:49:02 +08:00
David Adam
112178a2ac Release 3.6.4 2023-12-05 22:16:18 +08:00
David Adam
4a618f14f1 Release 3.6.3 2023-12-04 23:54:24 +08:00
David Adam
a51437ec83 Release 3.6.2
Fix for CVE-2023-49284.
2023-12-04 23:00:02 +08:00
David Adam
c0de5dd804 CHANGELOG: fix date for 3.6.1
(cherry picked from commit e2579a59ba)
2023-12-04 23:00:01 +08:00
Christian Fersch
1980a22522
git completion: Handle aliases referencing other aliases (#9992) 2023-11-24 17:03:02 +01:00
Nicholas Rodrigues Lordello
66401f8575 ls No Longer Sets LS_COLORS
(cherry picked from commit 5cf36bf3f8)
2023-11-07 19:59:29 +01:00
Nicholas Rodrigues Lordello
5cf36bf3f8 ls No Longer Sets LS_COLORS 2023-11-07 17:45:45 +01:00
Fabian Boehm
c883d73145 Work on 3.7.0 CHANGELOG 2023-10-17 17:49:34 +02:00
Kevin F. Konrad
269c9c3f0c
add completions for crc and oc (#10034) 2023-10-01 08:38:27 +02:00
Gregory Anders
33c6eee9d2 Check terminfo for ts capability to determine title setting support 2023-09-30 10:09:52 +02:00
ghostflyby
c17fc65321 Update CHANGELOG.rst 2023-09-01 10:27:18 -07:00
Fabian Boehm
e52e7cea43 CHANGUELOGUE 2023-08-30 23:15:01 +02:00
Fabian Boehm
36a7924fa8 CHANGELOG: Document incompatible changes 2023-08-22 15:27:00 +02:00
Gregory Anders
69ef51f417 Enable PWD reporting for iTerm2 2023-08-14 18:09:12 +02:00
Emily Grace Seville
f9d21cc21d
Add horcrux completion (#9922)
* feat(completions): horcrux

* feat(changelog): mention completion

* fix(completion): condition for -n
2023-08-09 17:30:34 +02:00
Fabian Boehm
bc56a0436b CHANGELOG: Add 3.6.2 section 2023-08-03 18:17:05 +02:00
Henrik Hørlück Berg
6dd2cd2b20 Fix behaviour in the presence of non-visible width
Padding with an unprintable character is now disallowed, like it was for other
zero-length characters.

`string shorten` now ignores escape sequences and non-printable characters
when calculating the visible width of the ellipsis used (except for `\b`,
which is treated as a width of -1).
Previously `fish_wcswidth` returned a length of -1 when the ellipsis-str
contained any non-printable character, causing the command to poentially
print a larger width than expected.

This also fixes an integer overflows in `string shorten`'s
`max` and `max2`, when the cumulative sum of character widths turned negative
(e.g. with any non-printable characters, or `\b` after the changes above).
The overflow potentially caused strings containing non-printable characters
to be truncated.

This adds test that verify the fixed behaviour.
2023-07-27 22:00:03 -07:00
Emily Grace Seville
6ce2ffbbb0
Add Krita completions (#9903)
* feat(completions): support Krita

* feat(completions): support summary options for Krita

* feat(completions): support remaining options for Krita

* feat(completions): remove debug instructions

* feat(completions): hide completions for sizes for Krita

* feat(completions): fix Krita

* feat(changelog): mention new completion

* fix(completions): refactor Krita

* fix(completion): reformat

* feat(completion): dynamically generate workspace list

* fix(completion): refactor

* fix(completion): krita

* fix(completions): use printf
2023-07-27 17:43:51 +02:00
Emily Grace Seville
8d3885b9cb
Add Blender completions (#9905) 2023-07-27 17:42:55 +02:00
EmilySeville7cfg
3fde15fd9a feat(changelog): explain changes 2023-07-23 15:09:35 -07:00
Henrik Hørlück Berg
6325b3662d Fix #9899 integer overflow in string repeat
We could end up overflowing if we print out something that's a multiple of the
chunk size, which would then finish printing in the chunk-printing, but not
break out early.
2023-07-17 15:41:08 +02:00
elyashiv
0dfef25b4c [CHANGELOG.rst] added line about escaping jobs 2023-07-10 18:38:26 +02:00
ridiculousfish
b4570623e9 Changelog fix for #9863 2023-07-01 11:08:53 -07:00
ridiculousfish
908e234bf6 Changelog fix for #9833
Also relevant is #9812
2023-06-04 13:44:36 -07:00
Kevin F. Konrad
ffb6168221 implement completion for age and age-keygen 2023-05-27 11:15:37 -07:00
ridiculousfish
d4c3c77318 Changelog fix in #9776 2023-05-07 14:34:19 -07:00
AsukaMinato
36e4b0ff30
add completion for ar (#9720)
* add completion for ar

* clean the function

* update CHANGELOG
2023-04-10 11:01:47 +02:00
ridiculousfish
de24e84a48 Changelog fix for #9722 2023-04-09 11:34:45 -07:00
ridiculousfish
0ad3e3a45d Changelog fix for #9717 2023-04-08 20:23:21 -07:00
ridiculousfish
0b6605b026 CHANGELOG fix for #9700 2023-04-01 10:07:13 -07:00
ridiculousfish
df3f2d678c Changelog fix for #9699 2023-03-31 20:29:26 -07:00
David Adam
e2579a59ba CHANGELOG: fix date for 3.6.1 2023-03-25 22:57:24 +08:00
David Adam
83a9555b47 Merge branch 'Integration_3.6.1' 2023-03-25 17:19:33 +08:00
David Adam
f39bc9317d Release 3.6.1 2023-03-25 14:50:41 +08:00
David Adam
2f47f7d9c0 CHANGELOG: work on 3.6.1 2023-03-25 11:31:12 +08:00
NextAlone
37e7e90bff completion/ssh-copy-id: add completion (#9675)
Add completions for ssh-copy-id.

Refactored __ssh_history_completions into its own file for autoloading across
completions.

(cherry picked from commit 45b6622986)

Conflicts:
	CHANGELOG.rst
2023-03-22 12:30:01 -05:00
NextAlone
45b6622986
completion/ssh-copy-id: add completion (#9675)
Add completions for ssh-copy-id.

Refactored __ssh_history_completions into its own file for autoloading across completions.
2023-03-22 12:24:18 -05:00
David Adam
a1f79b3acc CHANGELOG: work on 3.6.1 2023-03-18 00:41:09 +08:00
David Adam
88043088f2 CHANGELOG: work on 3.6.1 2023-03-18 00:14:24 +08:00
Quinten Roets
f5506803d7
fish_vi_cursor: add new variable for external cursor mode (#9565)
* add new variable for external cursor mode

* fix backwards compatibility

* add documentation

* document change in changelog
2023-03-14 10:50:20 +01:00
David Adam
6ac8d76b2b CHANGELOG: work on 3.6.1 2023-03-11 22:59:36 +08:00
Fabian Boehm
fdd9fe27b8 CHANGELOG 2023-03-05 16:10:50 +01:00
ridiculousfish
7d48c5d44f Relnote change in #9634
Relnotes fastboot completion changes.
2023-03-04 12:25:20 -08:00
Fabian Boehm
74969f94fe CHANGELOG 2023-03-03 19:25:36 +01:00
Fabian Boehm
2b0f051eba CHANGELOG 2023-03-03 18:44:09 +01:00
Fabian Boehm
3bf3061d8c CHANGELOG 2023-03-02 16:35:08 +01:00
David Adam
9f83155fca CHANGELOG: work on 3.6.1 2023-02-27 22:27:15 +08:00
Shun Sakai
76d9de6282 Add completions for scrypt
(cherry picked from commit 189f4ca3c3)
2023-02-27 22:25:49 +08:00
bagohart
89880839e8 Add tab completion for stow (#9571)
(cherry picked from commit 3dd8db281b)
2023-02-27 22:25:26 +08:00
Jay
c42c3ebe6f completions/trash-cli: add completions for trash-cli (#9560)
Add completions for trash-cli commands:
trash, trash-empty, trash-list, trash-put and trash-restore.

``trash --help`` are used to identify the executable in trash cli completion.

(cherry picked from commit ce268b74dd)
2023-02-27 22:25:24 +08:00
bagohart
3fa5a808a0 Add separate completions for neovim (#9543)
Separate the neovim completions from the vim ones, as their supported
options have diverged considerably.

Some documented options are not yet implemented, these are added but
commented out.

Closes #9535.

---------

Co-authored-by: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
(cherry picked from commit ef07e21d40)
2023-02-27 22:24:52 +08:00
David Adam
f59edf23d0 CHANGELOG: work on 3.6.1 2023-02-21 22:06:32 +08:00
Wout De Puysseleir
d55ac1fb94 completions/mix: Add mix phx
- Added phx completions. These are very common completions for the Elixir Phoenix Framework.
  Documentation can be found here: https://hexdocs.pm/phoenix/1.7.0-rc.2/Mix.Tasks.Local.Phx.html#content
- Added argument completions
- Made all descriptions start with an uppercase for better consistency
- Update CHANGELOG.rst

(cherry picked from commit 43a7c20ddb)
2023-02-21 21:54:14 +08:00
Shun Sakai
189f4ca3c3 Add completions for scrypt 2023-02-19 10:22:01 -08:00
bagohart
3dd8db281b
Add tab completion for stow (#9571) 2023-02-18 18:37:45 +01:00
Xiretza
ba0bfb9df7 functions: list caller-exit handlers correctly
`functions --handlers-type caller-exit` did not list any functions, while
`functions --handlers-type process-exit` listed both process-exit and
caller-exit handlers:

$ echo (function foo --on-job-exit caller; end; functions --handlers-type caller-exit | grep foo)

$ echo (function foo --on-job-exit caller; end; functions --handlers-type process-exit | grep foo)
caller-exit foo
2023-02-18 18:35:40 +01:00
NextAlone
dcc8147147 docs: add apkanalyzer to changelog
Signed-off-by: NextAlone <12210746+NextAlone@users.noreply.github.com>
2023-02-15 19:00:47 +01:00