Commit graph

113 commits

Author SHA1 Message Date
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
Fabian Homborg
b3626d48e7 Highlight keywords differently
This introduces a new variable $fish_color_keyword that will be used
to highlight keywords. If it's not defined, we fall back on
$fish_color_command as before.

An issue here is that most of our keywords have this weird duality of
also being builtins *if* executed without an argument or with
`--help`.

This means that e.g.

    if

is highlighted as a command until you start typing

    if t

and then it turns keyword.
2021-02-07 21:18:51 +01:00
Fabian Homborg
2faf814da4 docs: Point away from set -x
This is a common anti-pattern, we should try to get people to do `set -gx`.
2021-02-01 18:12:24 +01:00
Fabian Homborg
6442dc96d6 docs: Add a loops section to index
This was only in the tutorial - we really should improve the split here.
2021-01-31 13:15:03 +01:00
Fabian Homborg
7eb616b787 docs: Make some things subsections
E.g. autoloading and aliases are both about functions, variable scope
and overrides are both about variables.

It makes sense to group these together, and this might allow us to
collapse some of the TOC later.
2021-01-31 12:34:47 +01:00
Fabian Homborg
02c11e1db5 docs: Put variable expansion before command substitution
That's the order the parent section lists it in.
2021-01-31 12:30:20 +01:00
Fabian Homborg
892330b904 docs: Drop "Other features" header
This has two features now, there's no need to group it.
2021-01-31 11:59:43 +01:00
Fabian Homborg
00fc56f3e1 docs: Drop weird local table of contents from "Installation" section
This is about a page long, it doesn't need links.
2021-01-31 11:57:51 +01:00
Fabian Homborg
ad560e2b80 docs: Expand a bit on the alias/abbr thing
Also move abbr explanation to interactive use (as abbrs are purely an
interactive concept)

(also add an example to tilde expansion, not making a separate commit
for that)
2021-01-31 11:56:19 +01:00
Fabian Homborg
8e8349d714 docs: Unify job control
Remove the redundant "running multiple programs" section and merge the
"job control" and "background" sections.
2021-01-31 11:49:54 +01:00
Fabian Homborg
9fead046b5 docs: Explain the man/help split in the help section 2021-01-31 11:41:46 +01:00
Fabian Homborg
cf800db10a docs: Move things from "Other features" to "Interactive use"
These are interactive features, after all
2021-01-29 20:08:37 +01:00
Fabian Homborg
711fa31871 docs: Remove broken footnote
Oops!
2021-01-27 18:25:46 +01:00
Fabian Homborg
dd64035d23 docs: Some adjustments
Rewordings, :ref: links, typos
2021-01-27 17:39:09 +01:00
Fabian Homborg
cbc9de3663 docs: Make the lines in the code examples shorter
We should typically avoid scrolling even at max-width.

An exception here is the output of `functions` - this prints one very
long line, but it's really not important what's in there specifically,
it's just to illustrate the kind of output you'd get.
2021-01-26 09:29:58 +01:00
Fabian Homborg
b59cad3c5b
Merge pull request #7654 from mattdutson/intro-doc
More improvements to clarity and grammar of Introduction doc page
2021-01-25 19:08:19 +01:00
Fabian Homborg
5f93df240e Fish for bash users: Fix missing word and link it from index 2021-01-22 16:23:09 +01:00
Fabian Homborg
1285957703 docs: Add glob example to variable overrides
And clarify that it'll still run the same things
2021-01-17 10:31:23 +01:00
Fabian Homborg
e192066e98 Add $fish_handle_reflow to disable winch handler
Overriding event handlers is annoying.
2021-01-15 18:37:06 +01:00
Matthew Dutson
d079026ecc Merge branch 'master' into intro-doc 2021-01-12 17:37:16 -06:00
Matthew Dutson
480f7fdb37 Revise "Piping" section 2021-01-12 17:24:23 -06:00
Fabian Homborg
b489137fa9 docs: Link to fish_key_reader 2021-01-09 13:13:48 +01:00
David Adam
a0764ef3d2 docs: note limits on parameter expansion from #7226
introduced in 594a6a3
2021-01-07 15:44:01 +08:00
ridiculousfish
118f710e99 Allow fish_private_mode to change at runtime
Prior to this change, `fish_private_mode` worked by just suppressing
history outright. With this change, `fish_private_mode` can be toggled on
and off. Commands entered while `fish_private_mode` is set are stored but
in memory only; they are not written to disk.

Fixes #7590
Fixes #7589
2021-01-02 22:01:47 -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
Matthew Dutson
0136db0a22 Revise through "Input/Output Redirection" section 2020-12-27 17:49:52 -07:00
Matthew Dutson
bc91a13ba3 Revise through "Quotes" section 2020-12-27 17:57:09 +01:00
Matthew Dutson
f3fee832d4 Revise through "Quotes" section 2020-12-26 14:45:48 -07:00
Fabian Homborg
39e1494c56 docs: A bit more on variables 2020-12-24 10:30:59 +01:00
Fabian Homborg
6aed132224 docs: More links to commands in index 2020-10-28 17:44:45 +01:00
Johannes Altmanninger
4081d58577 docs: use monospace for inline code snippets more consistently 2020-10-26 19:25:41 +01:00
Fabian Homborg
4bfda47449 Bind ctrl-r to search history if the commandline isn't empty
This is super cheesy.

One of the most common feature requests we get is "control-r must
search", even tho just using history-search-backward via e.g. up-arrow
is perfectly capable. The only real difference is that ctrl-r search
in other shells allows editing the search term by default, while we
stop the history search and edit the new commandline in those cases.

So, since the major problem is muscle-memory on ctrl-r,
let's just use that!

This makes ctrl-r do nothing on empty commandlines, and do
history-search-backward otherwise, so the basic flow of "press ctrl-r
to start history search, enter your search term, press ctrl-r to cycle
through matches" just works (except the first ctrl-r is useless and it
doesn't show anything).

See #602.
2020-10-23 13:42:54 +02:00
Charles Gould
f73ee30111 docs: Fix markup for code blocks 2020-10-10 21:49:33 +02:00
Fabian Homborg
d6d3abf59a Introduce $FISH_DEBUG and $FISH_DEBUG_OUTPUT variables
Same as the `--debug` and `--debug-output` options, can be enabled
when the option can't be passed, e.g. in linux shebangs.

Fixes #7359.
2020-09-28 17:46:37 +02:00
Johannes Altmanninger
16ae532368 Fix typos in docs 2020-09-25 19:33:01 +02:00
Fabian Homborg
7cac8886bf docs: Some more on argument handling
Reword and expand the list section, and add another explicitly on
argument handling.

Fixes #4630

[ci skip]
2020-09-23 18:48:05 +02:00
Fabian Homborg
c1912e5624 docs: Change hybrid_binding function name
Just "hybrid_bindings" won't trigger the mode prompt.

(yes, this is cheesy)

[ci skip]
2020-09-23 18:15:53 +02: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
c4b7abc6ef docs: Misc changes
Some formatting improvements, an explanation of $PWD, and some updates
- --on-process-exit is gone, the fish_command_not_found event is gone,
nobody has sent enhancements via the mailing list in years.

[ci skip]
2020-09-18 17:19:44 +02:00
Fabian Homborg
c53107a3ad docs: Destuffify
There really is no need to show our technical writing prowess here, we
can use plain english.

[ci skip]
2020-09-18 17:10:40 +02:00
Fabian Homborg
d95dc15dac docs: Some more on custom bindings
Show another fish_key_reader run, explain what keys we pressed,
explain the escape delay.
2020-09-18 17:09:44 +02:00
Fabian Homborg
7845539990 docs: Change "Builtin Commands" section
This harkens back to the days of fish's "we don't need no stinkin'
echo" minimalism. That's long past, we have a bunch useful builtins
now just because they are useful, not because they have to be builtins.

[ci skip]
2020-09-18 17:03:56 +02:00
Fabian Homborg
dca6eee55f docs: Less "the user", more "you"
The person reading this is "you". It's completely okay and sounds
better to address them directly.

When we're talking about OS users or users of fish script the reader
writes, "the user" is still okay.

[ci skip]
2020-09-18 16:53:59 +02:00
Fabian Homborg
c188ecf6c7 docs: Reword Tab Completion section
[ci skip]
2020-09-18 16:46:52 +02:00
Fabian Homborg
63adb6871b docs: "fish" is a normal word
We don't need to emphasize it with a monospace block.

Just on index.rst for now.

Work towards #6785.

[ci skip]
2020-09-18 16:40:09 +02:00
Fabian Homborg
021d4157ca Fix hybrid binding instructions
This needs to have the vi-bindings take precedence, so they need to be
executed *last*.

It just needs to tell them that they shouldn't erase all the bindings.

[ci skip]
2020-08-28 20:50:24 +02:00
Fabian Homborg
bc715c6eb4 docs: Reword some of the Special Variables section
[ci skip]
2020-08-27 17:07:23 +02:00
Aurelio Jargas
0304135d2b
docs: Use \ instead of \\ in examples (#7286)
Instead of informing the bell character (hex 07), the example was using
an escaped \ followed by x07.

    $ echo \\x07
    \x07
    $ echo \x07

    $ echo \x07 | od -a
    0000000 bel  nl
    0000002
    $

* docs: Use \u instead of \\u

Instead of informing the Unicode character 慡, this example was using an
escaped \ followed by u6161.

    $ echo \\u6161
    \u6161
    $ echo \u6161
    慡

Before:

    $ string escape --style=var 'a1 b2'\\u6161 | string unescape --style=var
    a1 b2\u6161

Now:

    $ string escape --style=var 'a1 b2'\u6161 | string unescape --style=var
    a1 b2慡
2020-08-26 18:29:03 +02:00
Xandor Schiefer
ed212c631c Correct Emacs bindings in vi insert mode
The original instruction does not actually enable Emacs key bindings in Vi mode. This fixes it.
2020-08-23 12:56:27 -07:00
Soumya
a2b2bcef6e Add a $status_generation variable that's incremented for each interactive command that produces a status.
This can be used to determine whether the previous command produced a real status, or just carried over the status from the command before it. Backgrounded commands and variable assignments will not increment status_generation, all other commands will.
2020-08-05 12:23:49 -07:00