Commit graph

12635 commits

Author SHA1 Message Date
Awal Garg
cb5eb72c6b Skip pre/post exec events for empty commands (#4829) 2020-06-06 16:31:33 -07:00
David Adam
c5e535e794 docs: link and explicit instructions on creating a blank fish_mode_prompt
Work on #5783.

[ci skip]
2020-06-06 22:52:13 +08:00
Fabian Homborg
0846fc8181 Manparser: Also replace \(cq escapes in the non-Deroff manparser
I'm not entirely sure why we have multiple parsers here, but I'm
guessing there's a reason.

Fixes #7086.
2020-06-06 16:23:43 +02:00
Fabian Homborg
ab2db135ba docs: Add first draft of fish-vs-bash
That name's probably not the correct one.

The idea is to have a quick primer document for people coming from bash.
2020-06-05 19:19:23 +02:00
Fabian Homborg
801ab95fd0 docs: Explain $XDG_CONFIG_HOME 2020-06-05 19:18:09 +02:00
Fabian Homborg
77fc83c293 docs: Reword history substitution
That prepend-sudo note was a bit awkward. I'm still not super happy
with it, but it should be better.

Also remove the "simple but effective" comment.
2020-06-05 19:17:19 +02:00
Fabian Homborg
a8d1eb83da CHANGELOG
[ci skip]
2020-06-04 18:29:31 +02:00
Fabian Homborg
e646285bcb
Let __fish_prepend_sudo use the last commandline if there is no current one (#7079)
* docs/faq: Mention prepend_sudo

[ci skip]

* __fish_prepend_sudo: Use $history[1] if commandline is empty

Currently, if you press alt+s with an empty commandline, it inserts
"sudo", which seems fairly useless.

Now, it inserts "sudo " followed by the last history entry, which
makes it a replacement for `sudo !!`.

* docs
2020-06-04 18:25:02 +02:00
Charles Gould
3692d63188 completions: shorten fzf descriptions 2020-06-04 18:24:11 +02:00
Charles Gould
0f4ed5b6b8 completions: shorten base64 descriptions 2020-06-04 18:24:11 +02:00
Charles Gould
fd2eb26ee3 completions: fix typo for mktemp 2020-06-04 18:24:11 +02:00
Fabian Homborg
44184f68e4 Add status dirname and status basename convenience commands
There's a terrible number of fishscripts that start with

    set path (dirname (status filename))

And that's really just a bit boring.

So let's let it be

    set path (status dirname)
2020-06-04 18:23:32 +02:00
Alexander Sieg
af2d19bde0
completions: add hikari completion (#7083)
* completions: add hikari completion

* requested changes by code reviewer
2020-06-04 18:22:25 +02:00
Fabian Homborg
5efe1a09ce docs/argparse: Add note on optional arguments
Yeah I had to answer this one again.

[ci skip]
2020-06-04 17:28:02 +02:00
Fabian Homborg
0064279905 Don't show greetings in read in scripts
This reverts commit 1b0ec21773.

"Interactive" has multiple meanings here, one of them being "the whole shell" is interactive, which `status is-interactive` tests, and one "this interaction is interactive", which happens when `read`ing in a script.

Fixes #7080.
2020-06-04 17:00:09 +02:00
Jason
4dff15b74e
kdeconnect-cli completions: ignore stderror (#7074)
* kdeconnect-cli completions: ignore error messages

* squash this please
2020-06-03 16:12:52 +02:00
Fabian Homborg
f25f15fd69 completions: Fix leftover "^" redirections 2020-06-02 21:43:32 +02:00
Fabian Homborg
1af1e7b69b CHANGELOG: Fix formatting 2020-06-02 17:39:36 +02:00
Kristofer Rye
146ec619d9 Add "alacritty" to the list of known titleable TERMs
This change is necessary to fix dynamic titles for the Alacritty
terminal.  We do this by simply adding the (wchar_t *) literal
L"alacritty" to the end of the title_terms array.  This variable is
ultimately used in the subsequent function
does_term_support_setting_title (dtsst) for the purposes of whitelisting
certain terminals.

If an Alacritty user does not have the terminfo for alacritty present in
their terminfo database, Alacritty sets the TERM variable to
"xterm-256color", but if the terminfo for Alacritty is present, TERM is
instead set to "alacritty".

Prior to this change, none of the "fallback patterns" in the dtsst
function (which is used to ultimately decide whether or not a given
value of the TERM environment variable is supported) would apply to a
value of "alacritty".  Ordinarily, the dtsst function would return true
if nothing matches, but one of the final checks involves testing the
result of ttyname_r to see if it contains the substring "tty", which
causes dtsst to return false.  In the case where TERM="alacritty", this
is erroneous, because Alacritty does, indeed, support changing its title
and will also silently ignore attempts to change the title if that
behavior has been disabled by the user [1].

The changed file, src/env_dispatch.cpp, was reformatted by clang-format
in accordance with the documented procedures for contributors.

Signed-off-by: Kristofer Rye <kristofer.rye@gmail.com>

[1]: 1dacc99183/alacritty_terminal/src/term/mod.rs (L896-L900)
2020-06-01 19:06:32 -07:00
Fabian Homborg
4d487f711d Don't use cbegin/cend
This has problems on old gcc, and isn't super necessary.
2020-06-01 15:52:15 +02:00
Fabian Homborg
4e16310940 Some more CHANGELOG 2020-06-01 15:51:45 +02:00
Fabian Homborg
90b01fd915 set: Show pathvariableness in --show 2020-06-01 15:51:10 +02:00
Fabian Homborg
4eb906c8d8 CHANGELOG Work towards 3.2
[ci skip]
2020-06-01 11:52:47 +02:00
John Zhang
8096d10bf1 remove redundant if conditions
All pcre2 resource free functions handle null pointer gracefully.
2020-05-31 17:10:09 -07:00
ridiculousfish
3ae91f197d Remove SIGTTOU handler before restoring foreground process group
When fish exits, it tries to restore the foreground process group.
However this may actually steal control of the fg process group
from another process. Fix this by clearing the SIGTTOU handler so
that tcsetpgrp() will fail.

Credit to @mqudsi for awesome debugging.

Fixes #7060
2020-05-31 14:11:39 -07:00
ridiculousfish
03208acb60 Don't call redirect_tty_output when restoring the front process group
redirect_tty_output was a clumsy attempt to work around a glibc bug, but
it's not necessary if fish is about to exit.
2020-05-31 13:51:47 -07:00
ridiculousfish
a2ae2d6c36 Attempt to truncate prompts that are too wide
Prior to this change, if the user's prompt was wider than the terminal, we
would reduce it to just `> `. With this change, attempt to truncate the
prompt.

For each line of the prompt, calculate its width. If the width exceeds
COLUMNS, prepend ellipsis to that line, and start removing characters
until it fits. Escape sequences are skipped.

Fixes #904
2020-05-31 09:58:47 -07:00
David Adam
2c6e95ccf6 debian packaging: change README.md to README.rst 2020-05-31 17:11:12 +08:00
ridiculousfish
67a4b35838 Migrate cached_layouts into layout_cache_t 2020-05-30 15:00:28 -07:00
ridiculousfish
7cc99a2d80 Rename job_tree to job_group
Initially I wanted to pick a different name to avoid confusion with
process groups, but really job trees *are* process groups. So name them
to reflect that fact.

Also rename "placeholder" to "internal" which is clearer.
2020-05-30 14:22:44 -07:00
ridiculousfish
b119c4b3bb Eliminate pgroup_provenance_t
Now that job trees are a single source of truth for a job's pgid, we no
longer need fancy logic around how the pgroup is assigned.
2020-05-30 14:22:44 -07:00
ridiculousfish
f37a44db16 Migrate job pgid from job to job tree
Prior to this, jobs all had a pgid, and fish has to work hard to ensure
that pgids were inherited properly for nested jobs. But now the job tree
is the source of truth and there is only one location for the pgid.
2020-05-30 14:22:44 -07:00
ridiculousfish
a86d3f4136 Remove job_lineage_t
Its responsibilities are now subsumed by job_tree_t except for
the block_io which we pass around explicitly.
2020-05-30 14:22:44 -07:00
ridiculousfish
55db918d59 Start to unwind lineages
job_lineage was used to track "where jobs came from" but the job tree idea is
a better abstraction. It groups jobs together similar to how a process group
would in other shells. Begin to remove the notion of lineage.
2020-05-30 14:22:44 -07:00
ridiculousfish
a4b66d948b Add a property describing when a job is initially backgrounded
Track separately whether a job is in the background now, and whether
it was constructed in the background via the & syntax.
2020-05-30 14:22:44 -07:00
ridiculousfish
123f3e6f93 Put job_id into job_tree
Job IDs are really a property of a job tree, not individual jobs. Reflect
that fact by migrating job IDs into job_tree.
2020-05-30 14:22:44 -07:00
ridiculousfish
fe60f2ef16 Move root_has_job_control from lineage to job_tree
Whether we have job control is a property of the job tree, not of
individual jobs. Reflect that fact directly by moving it into the job tree.
2020-05-30 14:22:43 -07:00
ridiculousfish
e95bcfb074 Teach a job to decide its job tree
Job trees come in two flavors: “placeholders” for jobs which are only fish
functions, and non-placeholders which need to track a pgid. This adds
logic to allow a job to decide if its parent's job tree is appropriate,
and allocating a new tree if not.
2020-05-30 14:22:43 -07:00
ridiculousfish
4e01c06256 Introduce job_tree
job_tree represents the data that should be shared between a job and any
jobs that may be spawned by functions or eval run as part of that job. It
reifies shared data that before was handled piecemeal.
2020-05-30 14:22:43 -07:00
Mahmoud Al-Qudsi
7e61205294 Make sure p->last_jiffies doesn't change after sanity checking
See 821525e503 and #7066
2020-05-30 16:05:29 -05:00
Mahmoud Al-Qudsi
821525e503 Defend against race condition calculating job cpu usage
Closes #7066
2020-05-30 16:00:34 -05:00
Mahmoud Al-Qudsi
f4ae69a905 fixup! Recover from bad redirections in the middle of a job pipeline
Fix inadvertent early abort (thanks, nested switch-in-for-loop!) that
led to subsequent shell input being broken.
2020-05-30 10:37:46 -05:00
Jason
fd7bb14cf2
completions: update xrandr (#7065)
* completions: update xrandr

Adds new options from new version of xrandr

* xrandr: remove version checks
2020-05-30 12:11:26 +02:00
Fabian Homborg
1f434cfde8 fish_config: Don't mention python 2
See #6537.

[ci skip]
2020-05-30 12:10:24 +02:00
Jason Nader
b4ca4245c6 gpg completions: add export SSH command 2020-05-30 10:10:07 +02:00
Charles Gould
dcf4d671c2 completions: fish_add_path 2020-05-30 10:09:21 +02:00
Fabian Homborg
99c2c599f3 docs: Mention that reloading can take a bit
Fixes #7064.
2020-05-30 10:07:21 +02:00
Fabian Homborg
4f6851b19f Add CHANGELOG to the docs
This uses a cheesy trampoline file, but it seems to work alright.
2020-05-30 10:07:21 +02:00
Fabian Homborg
3518432531 CHANGELOG: Fix some rst conversion leftovers
Apparently pandoc likes using `~~~` for sections, but sphinx does not.
2020-05-30 10:07:21 +02:00
Fabian Homborg
382595e1e9 Update some .md references 2020-05-30 10:07:21 +02:00