Commit Graph

11202 Commits

Author SHA1 Message Date
239
f1e4dc7ca8 Fixed completion for zpaq 2019-12-12 14:14:43 +01:00
Johannes Altmanninger
a446085c40 Update nmcli completions
Set variables for available connections and SSIDs only when the completion is loaded.
This is not perfect but faster than scanning for connections everytime.

Don't complete connection UUID, DBUS-PATH, ACTIVE-PATH because they are unintelligible.
Instead only complete the connection name.

See #6379

[ci skip]
2019-12-12 11:53:37 +01:00
Shun Sakai
11d529557a Update nmcli completions 2019-12-12 11:53:37 +01:00
Johannes Altmanninger
d22c7ab993 enhance sudo completions
Flag e/edit does not take an argument, so `sudo -e a` TAB would complete
subcommands.

[ci skip]
2019-12-12 09:08:42 +01:00
ridiculousfish
c0b3be9fb4 Stop storing block_io in job_t
Prior to this fix, a job would hold onto any IO redirections from its
parent. For example:

    begin
        echo a
    end < file.txt

The "echo a" job would hold a reference to the I/O redirection.
The problem is that jobs then extend the life of pipes until the job is
cleaned up. This can prevent pipes from closing, leading to hangs.

Fix this by not storing the block IO; this ensures that jobs do not
prolong the life of pipes.

Fixes #6397
2019-12-11 16:34:20 -08:00
Dan Martinez
16dc606001 Add the --short flag to type (#6403)
* Add the `--succinct` flag to `type`

* Use `echo` rather than `printf`

* Change `succinct` to `short`; print path if known

* Clean up the printing logic ever so slightly
2019-12-11 22:24:29 +01:00
Jason
0b53e51634 Remove translations for non-existent files/functions 2019-12-11 22:22:58 +01:00
Fabian Homborg
0b36d94006 docs: Link to the fish-doc and fish-tutorial pages from fish(1)
Just a brief explanation what that page is good for and how to get the
full scoop.

Fixes #5521.

[ci skip]
2019-12-11 20:59:17 +01:00
ridiculousfish
970288c854 Migrate the read limit into parser_t::libdata
It is more natural here than "on the last bufferfill."
2019-12-11 11:50:52 -08:00
Fabian Homborg
ff4498ceec CHANGELOG: Add some nice bits
[ci skip]
2019-12-11 20:50:23 +01:00
Johannes Altmanninger
cc7ae03070 prompt: don't consider SIGPIPE a failure
[ci skip]
2019-12-11 11:32:58 +01:00
Johannes Altmanninger
94b5720343 prompt: remove fallback for $fish_color_host
This was mostly dead, since $fish_color_host is set to normal in
__fish_config_interactive. The assignment was only used if the user
explicitly unsets fish_color_host (which they shouldn't, really).
Anyway it's weird to use cyan, use normal instead.
[ci skip]
2019-12-11 11:32:58 +01:00
Johannes Altmanninger
2f1a5e65d8 prompt: don't set default colors twice
The colors are set in __fish_config_interactive before the prompt is
painted for the first time.

Also initialize the $fish_color_status for the (pipe) status, bump the
version for that.
[ci skip]
2019-12-11 11:32:58 +01:00
Johannes Altmanninger
3f10da0d01 Persist new zero-length universal variables
Because of default initialization to an empty list, code that relies on
set -U __fish_init_3_x was run every time.
2019-12-11 11:32:58 +01:00
ridiculousfish
0b1af1ace4 Correct the use of the constructed pointer in job lineage
This was always being set to a different pointer. Ensure the root job
shares its constructed pointer with its children.
2019-12-10 18:32:56 -08:00
ridiculousfish
1e15aa4c4a Correctly style io_chain_t::print 2019-12-10 17:21:03 -08:00
ridiculousfish
0573e95b03 Resurrect io_print 2019-12-10 17:18:37 -08:00
Johannes Altmanninger
d4a3b30b73 prompt: move status to the right in classic_status sample prompt
This is consistent with the other prompts that include status.

[ci skip]
2019-12-11 01:19:12 +01:00
Johannes Altmanninger
6902459566 prompt: don't print status of last process in pipe twice
If a command fails, print the pipestatus in red instead of yellow and
don't print the status of the last process again. See #6375.

Also use $fish_color_status for coloring status consistently.

Also use __fish_pipestatus_with_signal to print SIGPIPE instead
of a numeric code on e.g.: yes | less +q

[ci skip]
2019-12-11 01:19:12 +01:00
ridiculousfish
eaa87ff885 Correct a comment
A comment claimed that 0 was STDOUT_FILENO. In fact this should be 1.

Also default the fd for pipe_or_redir_t to -1, as 0 is not a sensible
default.
2019-12-10 16:14:34 -08:00
Johannes Altmanninger
6b2addd9f3 prompt: don't print pipestatus if only the last process failed
Example: ps | grep something

[ci skip]
2019-12-10 22:35:24 +01:00
Fabian Homborg
6da4b682db docs: Separate scripting/interactive sections
[ci skip]
2019-12-10 21:05:21 +01:00
Fabian Homborg
b491e2bbfc docs: Turn some sections into subsections
[ci skip]
2019-12-10 21:01:09 +01:00
Fabian Homborg
15c6d8fd4c completions/zstd: Remove code to figure out number of CPUs
This purported to need python > 3.4, but used anypython.

Plus it's not super useful anyway since it can easily be told to
use *all* cpus, so there's no need to set it to the precise number.

See #6400.

[ci skip]
2019-12-10 20:20:21 +01:00
Fabian Homborg
ea7868988a docs: Remove "simple"
This just reads condescending. The user can decide for themselves how
simple something is.

[ci skip]
2019-12-10 19:05:37 +01:00
Fabian Homborg
eb7837113f docs: File completion can indeed be enabled again
[ci skip]
2019-12-10 19:03:44 +01:00
Fabian Homborg
8a5eda3e9b docs: Some nits
[ci skip]
2019-12-10 18:47:46 +01:00
Fabian Homborg
2b6b6a0de0 docs: Link tutorial immediately 2019-12-10 18:47:14 +01:00
Fabian Homborg
d05b7614dd Reorder setup instructions
First tell them how to install (though we don't actually do that right
now), then tell them how to start it, and only *then* tell them how to
make it the default or uninstall it.

Just seems sensible to try it first then delete it.
2019-12-10 18:35:25 +01:00
Fabian Homborg
b35eca5d9b docs: Restructure introduction
Some more sections here were duplicated or not all that useful, and
it's weird to start with "Commands versus Functions".

Let's explain to people how to start fish, then let's get going.
2019-12-10 18:29:57 +01:00
Fabian Homborg
023eb48ba7 docs: More rewording
[ci skip]
2019-12-09 21:22:37 +01:00
Fabian Homborg
be8aac53a3 docs: Reword range expansion
[ci skip]
2019-12-09 21:22:37 +01:00
Fabian Homborg
c12232c24a docs: Some more wording changes
Try to sound more human, and also use footnotes. Footnotes are cool.

[ci skip]
2019-12-09 21:22:37 +01:00
Fabian Homborg
607eda7a7a docs: Streamline some of the introductory parts of index.rst
Really "what is a shell" is covered by the part where it says it
offers a commandline interface.
2019-12-09 21:22:37 +01:00
Akatsuki
efb72f1f91 Revert "Move __fish_systemd_machines into machinectl completion script"
This reverts commit 9c15b5b7a4.
2019-12-09 21:07:21 +01:00
ridiculousfish
f136d634eb Collapse a job's "parent stuff" into a new type job_lineage_t
Currently a job needs to know three things about its "parents:"

1. Any IO redirections for the block or function containing this job
2. The pgid for the parent job
3. Whether the parent job has been fully constructed (to defer self-disown)

These are all tracked in somewhat separate awkward ways. Collapse them
into a single new type job_lineage_t.
2019-12-08 15:03:07 -08:00
ridiculousfish
e3b8203187 Implement logger_t::log_fmt for narrow chars by trampolining to wide chars
This satifies the glibc.
2019-12-08 14:47:52 -08:00
ridiculousfish
92a16921bf Add a test to verify that processes get the right pgrps in pipelines 2019-12-08 13:45:24 -08:00
ridiculousfish
d47541a3d7 Add a tricky test to verify disowning an in-flight job
There's some logic in fish to prevent blowing up when an under-construction
job is disowned. Add a test for it.
2019-12-08 11:44:21 -08:00
ridiculousfish
2ec8cd3bca Remove a dead variable 2019-12-07 11:28:22 -08:00
ridiculousfish
f575c55f5b Migrate the logic to make empty functions succeed into the performer
This is a more natural place for this logic.
2019-12-07 11:06:54 -08:00
ridiculousfish
098fe86ebf Port empty functions test to littlecheck 2019-12-07 11:02:22 -08:00
ridiculousfish
a7f6fd22d4 Factor block and fish function execution into a "performer" std::function
In preparation for concurrent execution, invert the control of function and
block execution. Allow a process to return an std::function that performs the
the execution. This can be run on either the main or a background thread
(eventually).
2019-12-07 10:29:06 -08:00
Fabian Homborg
b2332e9f3e Switch default prompt to Classic+VCS
This has more info, in particular vcs and status.

The old default is still available as the "classic" prompt.

Fixes #6375.
2019-12-07 19:25:41 +01:00
Shun Sakai
b862c63905 Fix an issue that cannot run on non-Linux systems
If Python 3.4 or later installed on the system, complement to the
number of physical cores. In addition, even if the number of physical
cores cannot be obtained, it was fixed to run properly.
2019-12-07 12:21:51 +01:00
Shun Sakai
9510d317c1 CHANGELOG: add lz4 and zstd completions 2019-12-07 12:21:51 +01:00
Shun Sakai
8d56609734 Add zstd completions
Squashed commit of the following:

commit 55c8e73faff2418161404f012440acced09580e4
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 05:25:02 2019 +0900

    Implementation of `zstdless` completions

commit e81ae6f83fb9f23bdd6038fbf29ea594da098c2c
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 05:20:33 2019 +0900

    Implementation of `zstdgrep` completions

commit 2ade3a9c01bdc5b024f785c369fcb6c3e007cb19
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 04:50:42 2019 +0900

    Implementation of `pzstd` completions

commit 0b9cb86a6936f3de18db7b2c012da6efec89c8e8
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 04:39:52 2019 +0900

    Implementation of `zstdcat` completions

commit e4a4101d18a82fb06ee451560d079b9b81af5f3e
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 04:25:05 2019 +0900

    Implementation of `unzstd` completions

commit 88ad0af46d486a92ab3989c55abb3ff477e5a372
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 04:18:38 2019 +0900

    Implementation of `zstdmt` completions

commit 13f2bf7951501031c61a5c0f143b8a29eaa9437e
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Fri Nov 29 01:13:52 2019 +0900

    Implementation of `zstd` completions
2019-12-07 12:21:51 +01:00
Shun Sakai
bc2634eaaf Add lz4 completions
Squashed commit of the following:

commit 08ea083bf87a613675789937d7f6740daa26fc61
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Thu Nov 28 23:51:35 2019 +0900

    Implementation of `lz4cat` completions

commit 027adedfeb7bb65ffd46e44b4266df3d98368326
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Thu Nov 28 23:36:12 2019 +0900

    Implementation of `unlz4` completions

commit 522925450a8076d4a0d3377cd9233abc643bbbf7
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Thu Nov 28 23:19:45 2019 +0900

    Implementation of `lz4c` completions

commit 298ce5e05e3be2cac774063ed2ee8289ba53cf24
Author: Shun Sakai <sorairolake@protonmail.ch>
Date:   Thu Nov 28 23:02:52 2019 +0900

    Implementation of `lz4` completions
2019-12-07 12:21:51 +01:00
Peter Collingbourne
6dc4ac60ae Use $PWD to retrieve the current directory in __fish_move_last.
(command pwd) uses the system's implementation of pwd. At least the GNU
coreutils implementation defaults to -P, which resulted in symlinks being
expanded when switching between directories with nextd/prevd.
2019-12-07 12:20:31 +01:00
Jason
7999cd4f25 Remove fish_fallback_prompt function 2019-12-07 12:16:48 +01:00