Commit Graph

10100 Commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
a21c65a5ac Makefile: Correct search for cmake 2019-04-09 22:32:29 -05:00
Mahmoud Al-Qudsi
ab1519acef Fix high CPU usage in subsequent select(2) calls
The timeout was being reset to zero, so `select` was being called in a
very tight loop.

Closes #5761.
2019-04-09 21:10:30 -05:00
Mahmoud Al-Qudsi
49935f13df Add completions for git bisect
[ci skip]
2019-04-09 20:36:42 -05:00
Mahmoud Al-Qudsi
e296e3c505 Makefile: Replace literal cmake usage with $(CMAKE) 2019-04-09 20:06:41 -05:00
Mahmoud Al-Qudsi
20db22f0fe Add basic make shim for CMake
This lets non-developers simply `cd` into the fish source directory and
execute `make` to build the project. The Makefile searches for CMake and
hands over the build to it if it is available, otherwise an error
message is emitted. All dependency checking is left to CMake.

Non-fish-devs shouldn't have to concern themselves with what build
system fish developers have chosen, and building a random C++ project
should not be a chore in familiarizing one's self with all the various
build platforms out there.

CMake is instructed to use `ninja` if it is available, otherwise the
standard Unix Makefiles generator option is used.

(This has already been the behavior on BSDs since CMake was adopted.)
2019-04-09 19:58:48 -05:00
David Adam
d6a4694d9f tests: add test for invalid variable name in for loop
Work on #5800.
2019-04-09 20:10:57 +08:00
David Adam
c6c0c9bfdf use standard warning for invalid variable in for loop
Work on #5800.
2019-04-09 20:10:57 +08:00
Fabian Homborg
add0bd0538 docs: Fix refs to cartesian product
There's an explicit label for "cartesian-product", but the title is
"Cartesian Product*s*". So linking via with `thing <#link>`_ links the
title, so without the "s" it doesn't work.

From what I know, linking via :ref:`thing <label>` is preferred and
works better with other exports and across files?

I think I should take a doc holiday.

[ci skip]
2019-04-09 14:06:54 +02:00
Fabian Homborg
e9f2a2904b Update the year of the doc
Next I'm gonna join the Temple Of The Doc.

[ci skip]
2019-04-09 13:58:59 +02:00
Fabian Homborg
5aed0bbf88 docs: Remove underline for whitespace
This made it look like code was `echo_Hello_World` instead of `echo
Hello World`.

See #5696.

[ci skip]
2019-04-09 13:57:36 +02:00
Fabian Homborg
c2259cbb86 docs: Fix typo
Also removes a warning.

[ci skip]
2019-04-09 13:47:54 +02:00
Aaron Gyes
3b97e2d7ec Stop caching set_color output in rest of prompts
No more __fish_prompt_* variables.
2019-04-09 03:40:09 -07:00
Aaron Gyes
5f7f4c638f informative.fish: stop caching_set_color, use br* directly
No longer uses global vars to cache set_color output, this was
from before set_color was a builtin, it is pointless now.

This is also a prompt from before we had bright named colors,
and it appears it was relying on -o red to get bright red.
so use brred, etc.
2019-04-09 03:13:45 -07:00
Aaron Gyes
b002eb350c Get rid of __fish_repaint_root
it's identical to __fish_repaint - so just register that for both
variable change events.
2019-04-09 00:29:22 -07:00
ridiculousfish
ef88e959ac Merge branch 'pygments'
This adds support for a fish_indent driven pygments syntax highlighter
to the sphinx docs build.
2019-04-08 20:14:12 -07:00
ridiculousfish
1fb05d8fa0 Add fish specific css to docs 2019-04-08 19:13:58 -07:00
ridiculousfish
e85cb25883 Switch to fish_indent based syntax highlighting in sphinx docs 2019-04-08 19:11:22 -07:00
ridiculousfish
93cc99d6d0 Teach CMake to tell Sphinx where fish_indent is 2019-04-08 19:11:10 -07:00
ridiculousfish
5b2c741f6c Add fish_indent_lexer.py
This is a pygments lexer that shells out to fish_indent
2019-04-08 19:09:53 -07:00
ridiculousfish
e44cb235a7 Add pygments CSV output to fish_indent
This will allow pygments to highlight fish code using fish_indent.
2019-04-08 19:09:41 -07:00
ridiculousfish
51e5077d98 Merge branch 'env_dispatch'
This merges a bunch of changes that migrate logic from env.cpp to a new file
env_dispatch.cpp. env_dispatch is concerned with dispatching changes to
variables, while env.cpp is the "core."
2019-04-08 16:22:22 -07:00
ridiculousfish
3e14f96d40 Eliminate string_set_contains 2019-04-08 16:22:04 -07:00
ridiculousfish
1caf20f7c3 Migrate the read limit into env_dispatch 2019-04-08 16:22:04 -07:00
ridiculousfish
fa0a6ae096 Move locale and curses init from env to env_dispatch 2019-04-08 16:22:04 -07:00
ridiculousfish
11651dec7a Clean up env_stack_t::pop
Use the new dispatch mechanism to reduce duplication
2019-04-08 16:22:04 -07:00
ridiculousfish
a4fe3c87ae Switch certain environment callbacks from named to anonymous 2019-04-08 16:22:04 -07:00
ridiculousfish
987e41de12 Remove the op from env_dispatch
Environment dispatch passes strings like "ERASE" and "SET" but nobody
ever looks at those. Just get rid of them.
2019-04-08 16:22:04 -07:00
ridiculousfish
dc729653be Migrate pop complexity from vars_stack_t to env_stack_t
When popping a scope from the environment stack, we currently do a lot of
nonsense like looking for changed curses variables. We want to centralize
this in env_stack_t so that it can be migrated to the env_dispatch logic.
Move this logic up one level in preparation for doing that.
2019-04-08 16:22:04 -07:00
ridiculousfish
59fb5b1849 var_stack_t::pop() to return the popped node 2019-04-08 16:22:04 -07:00
ridiculousfish
0c5809a088 Minor cleanup of env_node_t 2019-04-08 16:22:04 -07:00
ridiculousfish
ab67354192 Migrate fish_use_posix_spawn into env_dispatch 2019-04-08 16:22:04 -07:00
ridiculousfish
e7de9cc371 Migrate some env initialization into env_dispatch 2019-04-08 16:22:04 -07:00
ridiculousfish
b67174b4a3 Clean up env_dispatch_table 2019-04-08 16:22:04 -07:00
ridiculousfish
b7fceddfc8 Refactor some environment code into env_dispatch.cpp
This new file is supposed to encapsulate all of the logic around
reacting to variable changes, as opposed to the environment core.
This is to help break up the env.cpp monolith.
2019-04-08 16:22:04 -07:00
Aaron Gyes
e5362a4ae5 wutil.cpp: fixup: don't involve the uninitialized parameter 2019-04-08 16:02:00 -07:00
Aaron Gyes
8eb05f8731 parse_execution.cpp: validate 'for' variable name
Fixes #5800
(that's a nice round number)
2019-04-08 11:23:00 -07:00
Aaron Gyes
dd9a26715d fcntl a little less
Setting O_CLOEXEC on closed file descriptors and getting E_BADF
should be faster than actually checking if an fd is open first.
2019-04-08 11:23:00 -07:00
ridiculousfish
bf40f84b06 Remove an unused variable 2019-04-07 15:07:36 -07:00
ridiculousfish
35b3f7fee8 Reduce loop count of pipeline test
Make the test run faster
2019-04-07 15:00:13 -07:00
ridiculousfish
f5bb8639d6 More aggressively inherit pgrps from parent jobs
Prior to this fix, a job would only inherit a pgrp from its parent if the
first command were external. There seems to be no reason for this
restriction and this causes tcsetgrp() churn, potentially cuasing SIGTTIN.
Switch to unconditionally inheriting a pgrp from parents.

This should fix most of #5765, the only remaining question is
tcsetpgrp from builtins.
2019-04-07 13:35:00 -07:00
ridiculousfish
4d62af7d40 Add pipeline tests
This adds a pipeline test covering the fix in the prior commit,
related to #5675. Note #5675 is NOT fully fixed by this.
2019-04-07 09:20:32 -07:00
ridiculousfish
39a9740997 Be less aggressive about reclaiming the foreground pgrp
Prior to this fix, in every call to job_continue, fish would reclaim the
foreground pgrp. This would cause other jobs in the pipeline (which may
have another pgrp) to receive SIGTTIN / SIGTTOU.

Only reclaim the foreground pgrp if it was held at the point of job_continue.

This partially addresses #5765
2019-04-07 09:20:32 -07:00
ridiculousfish
23d88e0e03 Add fish_test_helper executable
In tests we would like to arrange for an executable to invoke certain
system calls, e.g. to claim or relinquish control of the terminal. This is
annoying to do portably via e.g. perl. fish_test_helper is a little
program where we can add custom commands to make it act in certain ways.
2019-04-07 09:20:19 -07:00
Fabian Homborg
4d66c7896f docs: Fix some more formatting
One monster paragraph and two lists that weren't recognized as such.

RsT loves empty lines.

[ci skip]
2019-04-06 23:38:07 +02:00
Fabian Homborg
a447878cd7 docs: Remove &foo; escapes
I always hated these.

[ci skip]
2019-04-06 23:33:07 +02:00
Fabian Homborg
c4d0177d81 docs: Put some more important variables first
This section was linked when talking about $PATH, and $PATH is much
more important than $fish_color_something and $fish_emoji_width.

[ci skip]
2019-04-06 23:29:05 +02:00
Fabian Homborg
235266894b docs: Fix reference to FAQ
This adds a reference to one specific FAQ, so it adds a label for that
one question. It does not add the rest, because they currently aren't
linked. If you add a reference to an FAQ, you should add the label as
well.

[ci skip]
2019-04-06 23:23:48 +02:00
Fabian Homborg
78931d78bd completions/git: Handle diff --cached
Fixes #5785.

[ci skip]
2019-04-06 21:45:17 +02:00
Fabian Homborg
f1614a995a docs: Reword commandline -f
We don't refer to "readline functions" anywhere else, and "injecting"
them "into the reader" is an overly jargony way of expressing it that
only makes sense to someone familiar with the internals. And even then
the term "readline" is already taken by the "readline" library, used
by bash et al, but not by us.

So we pick the term "input functions", like we did in bind.

See https://stackoverflow.com/questions/55542839/what-does-commandline-f-repaint-in-fish-shell/55543411#55543411.

[ci skip]
2019-04-06 20:39:16 +02:00
Aaron Gyes
4e555aebec Remove is_whitespace and whitespace character string declarations
I don't doubt such functions and character arrays could be useful,
to keep things consistent, but they are not actually being used.
2019-04-06 02:07:56 -07:00