1979 Commits

Author SHA1 Message Date
David Adam
df56f7155e docs/interactive: add ctrl-n Vi mode documentation
Noted missing in #11082.

(cherry picked from commit b2eebbe194158270def1e7e941a7d4dd0b84a54a)
2025-02-13 00:13:11 +08:00
Fabian Boehm
9c40f72643 Add feature flag for turning off keyboard protocols
To work around terminal bugs.

The flag "keyboard-protocols" defaults to "on" and enables keyboard protocols,
but can be turned off by setting "no-keyboard-protocols".

This has downsides as a feature flag - if you use multiple terminals and
one of them can't do it you'll have to disable it in all,
but anything else would require us to hook this up to env-dispatch,
and ensure that we turn the protocols *off* when the flag is disabled.

Since this is a temporary inconvenience, this would be okay to ask
zellij and Jetbrains-with-WSL users.
2025-02-11 22:22:08 +01:00
Max Jacobson
e1349b9c4a Fix formatting of abbr example
I'm running fish 4.0b1 locally and I tried running `help abbr` and
browsing the docs. I noticed one example which wasn't formatted
correctly.

I'm not too familiar with rst, but based on looking at the file, it
seems that this is how example code should be represented.

(cherry picked from commit d47a4899b4179addaedd73f18cc1219bb6d9564a)
2025-02-11 22:51:24 +08:00
Johannes Altmanninger
65ac71edcc Make alt-{b,f} move in directory history if commandline is empty
alt-{left,right} move in the directory history (like in browsers).
Arrow keys can be inconvenient to reach on some keyboards, so
let's alias this to alt-{b,f}, which already have similar behavior.
(historically the behavior was the same; we're considering changing
that back on some platforms).

This happens to fix alt-{left,right} in Terminal.app (where we had
a workaround for some cases), Ghostty, though that alone should not
be the reason for this change.

Cherry-picked from commit f4503af037cf596f6dc4c2b2e39df703e3fd6d07.

Closes #11105
2025-02-06 19:15:03 +01:00
Fabian Boehm
378f452eaa Revert token movement bindings
Comments by macOS users have shown that, apparently, on that platform
this isn't wanted.

The functions are there for people to use,
but we need more time to figure out if and how we're going to bind
these by default.
For example, we could change these bindings depending on the OS in future.

This reverts most of commit 6af96a81a8c6ff5e632d4dda7448f5f01d7a5d35.

Fixes #10926
See #11107
2025-02-05 19:06:37 +01:00
David Adam
5aec9e3b47 docs/fish: minor style/proofing edits
Some checks failed
make test / macos (push) Has been cancelled
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
(cherry picked from commit be48d73599d01aa246ddfb2c2f03e094dacedf85)
2025-01-29 22:47:06 +08:00
David Adam
d7fb0308a7 docs/language: update target release for feature flags from 3.8 to 4.0
see also 24abbb6de7f044

(cherry picked from commit 1cf71656efbc98ff672cbd1ff3e31956d9adb9d1)
2025-01-29 22:47:05 +08:00
Ilya Grigoriev
fa5de3ece8 language.rst: make description of features more consistent (minor)
The version where a feature became the default is now described inline,
to make it a single source of truth. I could have fixed the other
section where this was described, but this seemed easier.

I also removed a few details that seem no longer relevant.

(cherry picked from commit 064d867873b96989fc5736a394d9264205905f7e)
2025-01-29 22:46:29 +08:00
Fabian Boehm
45439f07d7 Update tests and docs for 4.0 target 2025-01-16 13:38:26 +01:00
Fabian Boehm
806734cc56 Make new ctrl-c behavior "clear-commandline"
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
And leave the old behavior under the name "cancel-commandline".

This renames "cancel-commandline-traditional" back to
"cancel-commandline", so the old name triggers the old behavior.

Fixes #10935
2025-01-14 20:00:31 +01:00
Klaus Hipp
a9b7dd1a9b Fix typos in docs (#11015)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
(cherry picked from commit 9b67b2ae070bf29060e8d2c10a9d127fc1bf2dcf)
2025-01-07 21:32:23 +08:00
David Adam
13f7e6d0a5 docs/interactive: update key bindings added for 4.0
(cherry picked from commit 6c3150aa056f3f3c4316a0f130ae0f12850971a0)
2025-01-05 22:28:45 +08:00
Grant Hutchins
2f99a82700
Improve documentation for string escape
Some checks failed
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
Before, it unnecessarily stated that there are three `--style` options, when
there are actually four.

I also align the default `--style=script` argument to the beginning of the line
to match the other options visually for easier scanning.
2024-12-29 13:49:05 -08:00
Fabian Boehm
5f76fc3e41 Add status buildinfo (#10896)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
This can be used to get some information on how fish was built - the
version, the build system, the operating system and architecture, the
features.

(cherry picked from commit 6f9ca42a30ee982026958290fe24695131db5dc4)
2024-12-29 13:37:29 +01:00
Kid
701853fdd3 docs: Distinguish documents in sidebar
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
(cherry picked from commit a579abb81bf883486f8d89181ce99ba291d84893)
2024-12-28 08:42:59 +01:00
Fabian Boehm
d707a516d2 docs: Use grid in the CSS (#10942)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
Instead of hardcoded 230px margin.

This also makes the ToC only take up a third of the screen when
narrow, and lets you scroll the rest.

Without, you'd have to scroll past the *entire* ToC, which is awkward

Remaining issue is the search box up top. Since this disables the one
in the sidebar once the window gets too narrow, that one is important,
and it isn't *great*

(cherry picked from commit 9b8793a2df508ac5f2cc7eeee72720488fa6f422)
2024-12-25 14:50:29 +01:00
Fabian Boehm
7069f3fe40
Allow installable builds to be installed into a specific path (#10923)
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
* Pass path to install()

It was dirty that it would re-get $HOME there anyway.

* Import wcs2osstring

* Allow installable builds to use a relocatable tree

If you give a path to `--install`, it will install fish into a
relocatable tree there, so

PATH/share/fish contains the datafiles
PATH/bin/fish contains the fish executable
PATH/etc/fish is sysconf

I am absolutely not sold on that last one - the way I always used
sysconfdir is that it is always /etc. This would be easy to fix but
should probably also be fixed for "regular" relocatable builds (no
idea who uses them).

An attempt at #10916

* Move install path into "install/" subdir

* Disable --install harder if not installable
2024-12-22 18:13:29 +01:00
Fabian Boehm
be16eeef69 Make --install install without confirmation, and not exit 2024-12-13 19:19:26 +01:00
Fabian Boehm
6d28845c2b Automatically attempt to install
This is fairly subtle.

When installable, and we either can't find the version file or it is
outdated, we ask the user to confirm installation (just like `--install`).

We do that only if we are really truly interactive (with a tty!) to
avoid `fish -c` running into problems.
This check could be tightened even more, because currently:

```fish
fish -ic 'echo foo'
```

asks, while

```fish
fish -ic 'echo foo' < /dev/null
```

does not.

`fish -c` will still error out if it can't find the config, but it
will just run if it is out of date.
2024-12-13 19:19:26 +01:00
Fabian Boehm
74e0436c3c Document installable builds 2024-12-06 22:12:26 +01:00
Fabian Boehm
2343a6b1f1 docs: Read version from the version file
Makes it possible to generate the man pages without fish_indent
available.

(not the html docs because they highlight via fish_indent!)
2024-12-06 22:12:26 +01:00
Ambrose Bonnaire-Sergeant
3012020af3
doc: expand &| reference to full example (#10885)
* doc: expand &| reference to full example

* feedback
2024-12-04 20:13:00 +01:00
Fabian Boehm
c625a324ba docs/string-trim: Double down on the set of chars vs string thing
Some checks failed
make test / ubuntu (push) Has been cancelled
make test / ubuntu-32bit-static-pcre2 (push) Has been cancelled
Rust checks / rustfmt (push) Has been cancelled
Rust checks / clippy (push) Has been cancelled
make test / ubuntu-asan (push) Has been cancelled
make test / macos (push) Has been cancelled
2024-11-25 17:53:14 +01:00
Fabian Boehm
fcab68c591 docs/faq: Fix some broken keys 2024-11-21 18:28:43 +01:00
Fabian Boehm
6d76b938c7 bind: Remove "c-" and "a-" shortcut notation
These are another way to spell the same thing that doesn't match what
`bind` would print.

They're also not documented and tested thoroughly.

Since they are just small shortcuts and unreleased we can just remove
them.

Fixes #10845
2024-11-13 17:48:15 +01:00
Fabian Boehm
4b24fe7daf docs/export: Add a bit on PATH=$PATH:... 2024-11-06 18:50:41 +01:00
David Adam
0d9ad0f23b docs: add short documentation for export
Work on #10541.
2024-11-06 23:47:31 +08:00
Johannes Altmanninger
85404bf7a9 edit_command_buffer: speed up setting cursor position by line/column
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
alt-e restores the cursor position received from the editor, moving by
one character at a time.  This can be super slow on large commandlines,
even on release builds.  Let's fix that by setting the coordinates
directly.
2024-11-01 20:09:55 +01:00
Giorgio Gallo
677e53f06a fix documentation for path normalize
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
2024-10-27 08:32:05 +00:00
Johannes Altmanninger
d9633f2b38 Remove stale docs about fish_vi_force_cursor
Remove in 983746a69 (fish_vi_cursor: Remove terminal checks, 2024-08-30).
2024-10-21 21:53:32 +02:00
Johannes Altmanninger
f4ff312265 Fix typo in docs 2024-10-19 22:04:54 +02:00
Johannes Altmanninger
6af96a81a8 Default bindings for token movement commands
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
There is no natural default binding for token movements. Add the
alt-{left,right,backspace,delete}, breaking some existing behavior.

For example, backward-delete-word is no longer bound to alt-backspace but
only to ctrl-backspace.  Unfortunately some terminals (particularly tmux)
don't support distinguishing ctrl-backspace from ctrl-h yet, so the loss
of alt-backspace may be tragic.

---

I guess we could also add:

    bind alt-B backward-token
    bind alt-F forward-token
    bind ctrl-W backward-kill-token
    bind alt-D kill-token

Those might be intercepted by the terminal on Linux, but I don't know where
that happens.

Tested on foot, kitty, alacritty, xterm, tmux, konsole and gnome-terminal.

Closes #10766
2024-10-13 14:53:45 +02:00
diniamo
052e764f29 accept-autosuggestion to return false if there was no autosuggestion to accept
Example usage:

    bind ctrl-space accept-autosuggestion and execute

Closes #10608
2024-10-05 23:43:16 +02:00
Jacob Chapman
a9cee9e755 Commands to move by entire tokens
Some checks are pending
make test / ubuntu (push) Waiting to run
make test / ubuntu-32bit-static-pcre2 (push) Waiting to run
make test / ubuntu-asan (push) Waiting to run
make test / macos (push) Waiting to run
Rust checks / rustfmt (push) Waiting to run
Rust checks / clippy (push) Waiting to run
ja: I'll try to add default bindings in a follow-up PR.

Closes #10738
Closes #2014
2024-10-05 22:43:39 +02:00
Johannes Altmanninger
d829a99977 Fix kbd tag HTML rendering
Commit c921c124e (docs: use canonical key names in :kbd: tags, 2024-04-13)
removed the box highlighting from elements like :kbd:`ctrl-c`.
This is because Sphinx for some reason converts this into

    <kbd>
        <kbd>ctrl</kbd>
        -
        <kbd>c</kbd>
    </kbd>

which results in duplicate boxes.
(See https://github.com/sphinx-doc/sphinx/issues/7530)

Our current style looks a bit ugly (it's
definitely worse than github's rendering at
https://github.com/fish-shell/fish-shell/blob/master/CHANGELOG.rst).
Let's restore the old style but make sure to only apply it only to the
outermost kbd element.

While at it, use the same monospace font as for inline code.
2024-09-28 18:00:02 +02:00
Johannes Altmanninger
2e9de57fd7 Document ctrl-backspace and bind ctrl-delete as well
This has a slightly different behavior than what the CUA user expects:
it fails to eat up trailing spaces.  We should probably fix this.
2024-09-23 14:52:50 +02:00
Fabian Boehm
fc7be1c2a3 Minor doc fixes 2024-09-18 22:11:14 +02:00
Fabian Boehm
9fafae7a8a docs/complete: Explain -r a bit better 2024-09-15 09:44:09 +02:00
Fabian Boehm
8092af9c45 docs/prompt: Add funcsave/funced 2024-09-15 09:39:13 +02:00
Fabian Boehm
f9635b1a04 docs/argparse: Explain dashes in flag names 2024-09-15 09:39:09 +02:00
mattmc3
0a1bf01574 docs: Update synopsis for 'set' 2024-09-14 10:29:44 +02:00
Harmen
fc4dd8f4de docs: fix "theme choose None" command
The command needs an upper-case "None", not a lower case.
2024-09-13 12:21:34 +02:00
Fabian Boehm
325b51aca0 docs/set: Fix markup
Fixes #10697
2024-09-05 19:30:38 +02:00
Fabian Boehm
835f907cd4 docs: Remove broken indents in license
Lots of "WARNING: Block quote ends without a blank line; unexpected
unindent." from sphinx.
2024-08-15 17:48:48 +02:00
Fabian Boehm
da8fe7e845 docs: Point to functions/type from funced/funcsave
Fixes #10609
2024-08-13 17:44:23 +02:00
Fabian Boehm
1f7fdd5d88 Add back docs for fish_key_reader --verbose 2024-08-11 14:57:04 +02:00
David Adam
8d8a036e20 add some reminders about the many places copyright information is kept 2024-08-04 21:11:21 +08:00
Fabian Boehm
56a4ae17c9 docs: Make output not selectable
We already do this for the prompt
2024-08-03 16:26:34 +02:00
David Adam
8b028c37e5 Bring licensing information up to date and synchronise across files 2024-08-03 00:14:48 +08:00
Johannes Altmanninger
82639d274e string-replace.rst: fix trailing whitespace 2024-07-23 11:47:58 +02:00