Commit Graph

10813 Commits

Author SHA1 Message Date
Fabian Homborg
cc1388a78a Upgrade littlecheck to allow whitespace before comments
Necessary for test files that pass fish_indent.
2019-06-25 16:11:24 +02:00
Fabian Homborg
427a18c1ea fish_git_prompt: Add a way to use the informative chars
$__fish_git_prompt_use_informative_chars will use the informative
chars without requiring informative mode (which is really frickin'
slow!).

See #5726.

[ci skip]
2019-06-25 16:11:18 +02:00
Fabian Homborg
caedf01c00 Revert "Latch signal handlers"
This reverts commit 7ed1022cf4.

Fixes #5962.
2019-06-25 11:25:09 +02:00
Fabian Homborg
3bc392a6b3 functions/__fish_print_hostnames: Check getent's status
This previously effectively checked `string split ' '`s return status,
which was false if it didn't split anything. And while that should be
true if getent fails (because it should produce no output), it's also
true if it doesn't print a line with multiple aliases. Which should be
fairly typical.

Instead we use our new-found $pipestatus to check what getent returns,
in the assumption that it'll fail if it doesn't support hosts.

Follow up to 8f7a47547e.

[ci skip]
2019-06-25 08:40:31 +02:00
Fabian Homborg
9cd29e5166 cmake: Add -Wno-redundant-mode
This warns about one bit in env_dispatch, where a comment explains
that the move *is* necessary, on a different libc++.
2019-06-24 22:11:49 +02:00
Fabian Homborg
8f7a47547e functions/__fish_print_hostnames: Don't run getent hosts twice
`getent hosts` is expensive-ish - ~50ms, so we don't want to run it
twice just to figure out it works.

Apparently this works everywhere but CYGWIN and possibly older
OpenBSD, but we don't want to explicitly blacklist those.

[ci skip]
2019-06-24 19:19:31 +02:00
ridiculousfish
27e4d1d62d Revert "Revert "Don't service ioport completions if data is available on stdin""
This reverts commit 005e6f2ab8.

This allows new text entry to take priority over highlighting, improving the
performance of pasting.
2019-06-23 16:45:06 -07:00
ridiculousfish
89fb408eb6 Migrate some job flags into const properties struct
This helps clarify which parts of a job are mutable, and which are constant.
2019-06-23 12:42:44 -07:00
ridiculousfish
5362161343 Call tcsetgrp() in child processes again
25afc9b377 made this unnecessary by
having child processes wait for a signal after fork(), but this change
was later reverted. If we artificially slow down fish (e.g. with a sleep)
after the fork call, we see commands getting backgrounded by mistake.

Put back the tcsetgrp() call.
2019-06-23 12:42:44 -07:00
ridiculousfish
8255c01edb Rename setup_child_process to child_setup_process
Try to name all functions called after fork with "child" prefix.
2019-06-23 12:42:44 -07:00
Shun Sakai
e7b42615c8 Add FFmpeg completions (#5922)
* Add FFmpeg completions

* Fix to use builtin command
2019-06-23 16:40:26 +02:00
Fabian Homborg
e921bd60c3 docs: Build index, tutorial and faq as man pages
This was clearly intended for index, but because it was called "fish"
it was overwritten by the "fish" command man page.

I also added the tutorial and faq. Both of those might not be *ideal*
as man pages (the tutorial makes references to colors that won't show
up), but it's better to provide them than not.

Hat-tip to @wwared

See #5521.

[ci skip]
2019-06-23 16:16:44 +02:00
David Adam
8f3a0dcc8b cmake: harmonise argument to foreach/endforeach
Fixes a warning introduced in 40d91b7e77.
2019-06-23 16:00:40 +08:00
ridiculousfish
40d91b7e77 Allow running test suites independently
This makes test_low_level, test_interactive, test_invocation, and
test_fishscript independent. This allows running a smaller subset of tests.

To prevent all tests running in parallel, we also have new targets
serial_test_low_level, serial_test_interactive, etc. which have the
dependency chain that enforces serial execution.
2019-06-22 14:17:10 -07:00
ridiculousfish
db703c273d Remove some stale comments from Tests.cmake
These comments were used to refer back to the autotools build, but the
autotools build is no more and CMake is now the source of truth.
2019-06-22 13:12:49 -07:00
Fabian Homborg
8bfaf9e7ef Add test for erasing unloaded functions
Not perfect, but better than nothing.
2019-06-22 18:20:54 +02:00
Fabian Homborg
9b54a53758
Prevent not-yet-loaded functions from loaded when erased (#5951)
* Prevent not-yet-loaded functions from loaded when erased

Today, `functions --erase $function` does nothing if the function
hasn't been autoloaded yet.

E.g. run, in an interactive session

    > functions --erase ls
    > type ls

and be amazed that it still shows our default `ls --color=auto`
wrapper function.

This seems counter-intuitive - removing a function ought to remove it,
whether it had been executed before or not.

* doc/changelog
2019-06-22 11:08:36 +02:00
Lily Ballard
fe2ec1e4f8
Merge pull request #5943 from lilyball/string_collect
Add new `string` subcommand `string collect`
2019-06-22 00:30:20 -07:00
infix
ae2c40ebdb Updated DNF auto completion 2019-06-21 09:24:37 -07:00
Fabian Homborg
6c05005f0f docs: Document indexing double-variable-expansion
Fixes #5886.

[ci skip]
2019-06-19 12:56:01 +02:00
Fabian Homborg
370f5356a1 Move "character has no narrow representation" to flog
This was a warning, which is kind of ridiculous, as it's inactionable
error spew.

Fixes #2815.
2019-06-19 12:36:38 +02:00
ridiculousfish
9b9c6e312c Improve the docs from DEBUG_LEVEL to CATEGORY_GLOB
This stuff still isn't documented properly.
2019-06-17 09:07:43 -07:00
yogendra
ad1d81a090 Fix5910 documentation update 2019-06-17 09:01:30 -07:00
Lily Ballard
181e44d331 Invert the flag for string collect
Instead of requiring a flag to enable newline trimming, invert it so the
flag (now `--no-trim-newlines`) disables newline trimming. This way our
default behavior matches that of sh's `"$(cmd)"`.

Also change newline trimming to trim all newlines instead of just one,
again to match sh's behavior.
2019-06-16 16:40:14 -07:00
Lily Ballard
b41e5cbbb7 Add string collect
The `string collect` subcommand behaves quite similarly in practice to
`string split0 -m 0` in that it doesn't split its output, but it also
takes an optional `--trim-newline` flag to trim a single trailing
newline off of the output.

See issue #159.
2019-06-16 15:51:57 -07:00
ridiculousfish
5b5887ea99 Correct capitalization of complete_and_search 2019-06-16 14:38:27 -07:00
ridiculousfish
fcf0593dfb Port printf tests to littlecheck and teach the tester how to run it
This adds support for .check files inside the tests directory. .check
files are tests designed to be run with littlecheck.

Port printf test to littlecheck and remove the printf.in test.
2019-06-16 14:10:41 -07:00
ridiculousfish
476185748f Add littlecheck.py
This will be the new testing tool replacing the diff-based tests.

Imported from https://github.com/ridiculousfish/littlecheck
Version e28281273e54745c7d7aabeeb4b085af477d584b
2019-06-16 13:27:06 -07:00
Lily Ballard
5fd3bf79f5 Don't trim trailing whitespace on .rst files
Our existing .rst files have lines with trailing whitespace in them,
which I can only assume is deliberate, so update the editorconfig to
stop trimming trailing whitespace for these files.
2019-06-15 22:36:07 -07:00
ridiculousfish
360116221a Switch history_t to use owning_lock internally
This removes a lot of tricky manual locking. It also removes the "main
thread" dependency.
2019-06-14 20:49:17 -07:00
yogendra
6bed255a52 Fix Issue 5910 2019-06-14 08:56:42 -07:00
ridiculousfish
1c66d56d3a Add debug categories for reaping processes 2019-06-13 14:29:13 -07:00
Fabian Homborg
b4792bde19 Remove brew completions
Leave a note in place

Fixes #5892.

[ci skip]
2019-06-12 20:42:20 +02:00
Fabian Homborg
77103ddbab Dishonour
[ci skip]
2019-06-12 10:22:46 +02:00
Fabian Homborg
4db7efb569 docs: Fix fish_opt options
This said "--required" when the option is called "--required-val".

Fixes #5931.

[ci skip]
2019-06-11 14:10:39 +02:00
Fabian Homborg
e363552ef0 screen: Include termios for NetBSD
Otherwise it won't build.
2019-06-11 11:34:14 +02:00
Mahmoud Al-Qudsi
cfe1f1db9e Fix build on FreeBSD 12.0 with stock Clang
`isspace()` is in `ctype.h`.
2019-06-10 16:51:42 -05:00
ridiculousfish
aa950e5c13 Provide an optimized override of get_pwd_slash() 2019-06-10 10:26:33 -07:00
Fabian Homborg
38a7c77e4b Re-double-super-fix tilde completion crash
Yeah, I was too clever with the operators here.

Fixes #5929.
2019-06-10 18:50:40 +02:00
Fabian Homborg
5e78d6dcc9 CHANGELOG math "x"
[ci skip]
2019-06-10 18:46:06 +02:00
Fabian Homborg
d1ca392393 math: Allow "x" for multiplication
It's always a bit annoying that `*` requires quoting.

So we allow "x" as an alternative, only it needs to be followed by
whitespace to distinguish it from "0x" hexadecimal notation.
2019-06-10 18:45:10 +02:00
ridiculousfish
42138f00c6 Remove wchdir()
It's unused, and will soon be dangerous as the process-wide cwd will
lose meaning.
2019-06-10 09:37:08 -07:00
ridiculousfish
6637ccd3a2 Keep an fd for the cwd in the parser
To support distinct parsers having different working directories, we need
to keep the working directory alive, and also retain a non-path reference
to it.
2019-06-10 09:27:51 -07:00
ridiculousfish
6ce85aebc6 Switch file_io_t to store a wcstring
We no longer use file_io_t after fork(). We don't need to use a malloc'd
string any more. Use a wcstring.
2019-06-09 17:43:25 -07:00
ridiculousfish
0f9f00b54b Add a test that verifies cd handling in pipes 2019-06-09 16:08:00 -07:00
ridiculousfish
1baa479bbf Eliminate the global list of scoped transient commandlines
Store this in a parser's libdata instead.
2019-06-09 14:11:25 -07:00
ridiculousfish
421cf92380 Use a generation count for uvars exports
Because an exported universal variable must be exported in all variable
stacks, explicit invalidation is infeasible. Switch the universal variables
to a generation count.
2019-06-09 13:48:07 -07:00
ridiculousfish
7dffaf1a02 Reimplement exported variable change detection
Prior to this fix, fish would invalidate the exported variable list
whenever an exported variable changes. However we soon will not have a
single "exported variable list." If a global variable changes, it is
infeasible to find all exported variable lists and invalidate them.

Switch to a new model where we store a list of generation counts. Every
time an exported variable changes, the node gets a new generation. If the
current generation list does not match the cached one, then we know that
our exported variable list is stale.
2019-06-09 13:25:30 -07:00
ridiculousfish
79ee59adc0 Convert the create_export_array message to flog 2019-06-09 13:22:18 -07:00
Per Bothner
e05a0716e5 Make sure initial indentation is done using cursor move, not spaces.
The goal to allow a terminal to reliably distinguish user input
from indentation and prompts, in the context of shell integration.
2019-06-09 11:36:47 -07:00