Commit Graph

19929 Commits

Author SHA1 Message Date
Johannes Altmanninger
2d234bb676 Only request keyboard protocols once we know if kitty kbd is supported
Today we might
1. enable modifyOtherKeys
2. get a reply indicating the kitty keyboard protocol is supported
3. because of 2, we never turn off modifyOtherKeys again

Let's get rid of this weird issue by enabling either modifyOtherKeys
or the kitty enhancements only after we know whether the kitty protocol
is supported.

This means we need to call terminal_protocols_enable_ifn() before every
call to readch() until the querying is done.  Fortunately, this is
already in place in read_normal_chars(); there are other places that
call readch() but none of those is executed until querying has completed.
2025-01-26 15:39:21 +01:00
Johannes Altmanninger
64859fc242 Blocking wait for responses to startup queries
At startup we query for
- the cursor position (CSI 6 n)
- kitty keyboard protocol support (CSI ? u)
- terminfo capabilities via XTGETTCAP

Since we don't wait for responses, those can leak into child processes.
Some child processes like fzf cannot decode DCS replies.  Plug the
leak by ending each round of querying by asking for the Primary Device
Attribute, and resume input processing only after a response has been
received, (or ctrl-c as an escape hatch).

This is a nice simplification. Tested with the lowest common
denominator (putty, Terminal.app and st).

Fixes #11079
2025-01-26 14:22:52 +01:00
Johannes Altmanninger
06b49b9721 Update pexpect helper output sanitization 2025-01-26 14:19:40 +01:00
Johannes Altmanninger
630a06cf8f Work around st terminal resetting cursor on CSI ? u
The st terminal wrongly parses CSI ? u as DECRC. A fix has been
proposed upstream.  Let's also work around it I guess (not to mention
that querying in the first place is also sort of a workaround).
2025-01-26 14:19:40 +01:00
Johannes Altmanninger
95d61ea0fb Split /etc/{,man}path by colons too
I don't know how /etc/manpath ends up containing lines like
"path1:path2".  But path_helper splits them so we should do too.

4ea11424b8/path_helper/path_helper.c (L149)

Fixes #10684
2025-01-26 14:19:40 +01:00
Johannes Altmanninger
6e2c5d4365 Add trailing slash (not space) to variable name completions that produce valid paths
Closes #5798
2025-01-26 14:19:40 +01:00
Fabian Boehm
545a23734e Remove some ffi wrappers 2025-01-25 20:03:13 +01:00
Mahmoud Al-Qudsi
d69a9296a6 completions/llm: Complete model alias target 2025-01-25 12:50:03 -06:00
kerty
3fdd2d3fc2 Small refactor of HighlightSpec 2025-01-23 17:09:29 +01:00
kerty
db546da3ca Made undo/redo not update autosuggestion if failed 2025-01-23 17:09:29 +01:00
kerty
6a9f1b925d Make flash highlight autosuggestion on failed deletion 2025-01-23 17:09:29 +01:00
kerty
bffbf0cd57 Make flash highlight relevant commandline section 2025-01-23 17:09:29 +01:00
kerty
b5c869d5e7 Make parse_util_token_extent return its output instead of mutating input. 2025-01-23 17:09:29 +01:00
kerty
4994000a27 Small refactor of Reader::flash 2025-01-23 17:09:29 +01:00
ccoVeille
d5fdcc96c8 Fix typos in .rst files 2025-01-23 22:06:12 +08:00
Johannes Altmanninger
aee729bd44 Update changelog for cancel-commandline 2025-01-23 02:28:00 +01:00
Fabian Boehm
4e13ce33c5 functions/__fish_cancel_commandline: Follow rename of bind function
See #10935
2025-01-22 17:43:59 +01:00
Fabian Boehm
eab9e647f4 checks/tmux-history-pager: Disable on CI in general
Keeps failing for timing reasons and it's already quite slow.

See #11036
2025-01-21 17:32:27 +01:00
Fabian Boehm
e67819f532 Wrap libc::umask 2025-01-21 17:31:15 +01:00
Johannes Altmanninger
29cddabfe4 Fix regression causing fish_key_reader to not request kitty flags
Fixes 081c3282b7 (Refresh TTY timestamps also in some rare cases,
2025-01-15).
2025-01-21 14:09:33 +01:00
David Adam
945a535570 fish_default_key_bindings: remove duplicate ctrl-k binding
It's in the shared bindings since f9b7992.
2025-01-20 19:48:57 +08:00
Johannes Altmanninger
8208a12a76 Back out "Support help argument in "{ -h""
This backs out commit efce176ceb.
2025-01-19 18:57:21 +01:00
Johannes Altmanninger
d3c37de753 Back out "Always treat brace at command start as compound statement"
This backs out commit 98750e1ae5.
2025-01-19 18:57:21 +01:00
Johannes Altmanninger
a7fdd8d002 Back out "Back out "Remove awkward assert""
This backs out commit e0c6384ed3.
2025-01-19 18:57:21 +01:00
Johannes Altmanninger
92bd366c1b Back out "Allow if/then/fi, while/do/done and for/do/done"
This backs out commit e32572e4e6.
2025-01-19 18:57:13 +01:00
Fabian Boehm
5b0622cf00 Disable tmux-history-pager test on ASAN 2025-01-19 18:54:56 +01:00
Fabian Boehm
98a96f5b58 Revert "Swap alt-{left,right,backspace,delete} with ctrl-* on macOS"
This reverts commit ebdc3a0393.

Not discussed, includes a new thing that queries the terminal for the client OS
when what is really needed is just a `uname` - which would also work on Terminal.app.
2025-01-19 18:52:10 +01:00
Fabian Boehm
0494b1b608 tests/checks/exec: Match entire env line 2025-01-19 18:47:28 +01:00
Fabian Boehm
494bdfa013 Revert accidentally pushed fork
Revert "README for this fork"

This reverts commit 97db461e7f.

Revert "Allow foo=bar global variable assignments"

This reverts commit 45a2017580.

Revert "Interpret () in command position as subshell"

This reverts commit 0199583435.

Revert "Allow special variables $?,$$,$@,$#"

This reverts commit 4a71ee1288.

Revert "Allow $() in command position"

This reverts commit 4b99fe2288.

Revert "Turn off full LTO"

This reverts commit b1213f1385.

Revert "Back out "bind: Remove "c-" and "a-" shortcut notation""

This reverts commit f43abc42f9.

Revert "Un-hide documentation of non-fish shell builtins"

This reverts commit 485201ba2e.
2025-01-19 18:34:59 +01:00
Johannes Altmanninger
97db461e7f README for this fork 2025-01-19 18:29:07 +01:00
Johannes Altmanninger
45a2017580 Allow foo=bar global variable assignments
override fixes
2025-01-19 18:29:07 +01:00
Johannes Altmanninger
0199583435 Interpret () in command position as subshell 2025-01-19 18:29:07 +01:00
Johannes Altmanninger
4a71ee1288 Allow special variables $?,$$,$@,$# 2025-01-19 18:29:07 +01:00
Johannes Altmanninger
4b99fe2288 Allow $() in command position 2025-01-19 18:29:07 +01:00
Johannes Altmanninger
b1213f1385 Turn off full LTO 2025-01-19 18:29:07 +01:00
Johannes Altmanninger
f43abc42f9 Back out "bind: Remove "c-" and "a-" shortcut notation"
This backs out commit 6d76b938c7.
2025-01-19 18:29:07 +01:00
Johannes Altmanninger
485201ba2e Un-hide documentation of non-fish shell builtins
This makes "man exec" show the documentation from Linux man-pages.
2025-01-19 18:29:07 +01:00
Johannes Altmanninger
e32572e4e6 Allow if/then/fi, while/do/done and for/do/done 2025-01-19 18:29:07 +01:00
Johannes Altmanninger
ebdc3a0393 Swap alt-{left,right,backspace,delete} with ctrl-* on macOS
See https://github.com/fish-shell/fish-shell/issues/ 10926
2025-01-19 18:29:07 +01:00
Johannes Altmanninger
e0c6384ed3 Back out "Remove awkward assert"
This backs out commit 6126237bc4.
2025-01-19 18:29:07 +01:00
Johannes Altmanninger
98750e1ae5 Always treat brace at command start as compound statement 2025-01-19 18:29:07 +01:00
Johannes Altmanninger
efce176ceb Support help argument in "{ -h"
Unlike other builtins, "{" is a separate token, not a keyword-string
token.

Allow the left brace token as command string; produce it when parsing
"{ -h"/"{ --help" (and nowhere else).  By using a decorated statement,
we reuse logic for redirections etc.

Other syntax elements like "and" are in the builtin list, which
- adds highlighting logic
- adds it to "builtin --names"
- makes it runnable as builtin
  (e.g. "builtin '{'" would hypothetically print the man page)

These don't seem very important (highlighting for '{' needs to match
'}' anyway).

Additionally, making it a real builtin would mean that we'd need to
deactivate a few places that unescape "{" to BRACE_BEGIN.

Let's not add it to the built in list. Instead, simply synthesize
builtin_generic in the right spot.

I'm assuming we want "{ -h" to print help, but '"{" -h' to run an
external command, since the latter is historical behavior.  This works
naturally with the above fake builtin approach which never tries to
unescape the left brace.
2025-01-19 18:29:07 +01:00
kerty
f26ebac8dd Fix macOS quotation issue in test tmux-multiline-prompt.fish 2025-01-19 18:29:07 +01:00
kerty
4ce8037e73 Fix grep regex in test locale-numeric.fish 2025-01-19 18:29:07 +01:00
kerty
8116e80140 Add test for history pager 2025-01-19 18:29:07 +01:00
kerty
3436836b94 Add automatic history search page change when deleting last element on last page 2025-01-19 18:29:07 +01:00
kerty
4e965cba47 Separate SelectionMotion from HistoryPagerInvocation 2025-01-19 18:29:07 +01:00
kerty
9b14408b1b Make history search banner display start and end indexes 2025-01-19 18:29:07 +01:00
kerty
f28e43717b Fix history pager inconsistent ordering and skipping 13th elements 2025-01-19 18:29:07 +01:00
kerty
059e7424c1 Fix refreshing from deletion after forward search 2025-01-19 18:29:07 +01:00