Commit Graph

2791 Commits

Author SHA1 Message Date
Mahmoud Al-Qudsi
0cf0829c5f Add comment clarifying presence of empty eval function 2019-04-11 12:59:04 -05:00
Mahmoud Al-Qudsi
4d54147e7e Merge branch 'eval_parser'
Implements `eval` in cpp rather than as a fish function.
2019-04-11 10:41:33 -05:00
Mahmoud Al-Qudsi
2fe2169065 Make eval a decorator
`eval` has always been implemented as a function, which was always a bit
of a hack that caused some issues such as triggering the creation of a
new scope. This turns `eval` into a decorator.

The scoping issues with eval prevented it from being usable to actually
implement other shell components in fish script, such as the problems
described in #4442, which should now no longer be the case.

Closes #4443.
2019-04-11 10:36:49 -05:00
Aaron Gyes
90547a861a __fish_macos_set_env: don't create empty PATH components
It was creating empty entries for blank lines, which will actually
create '.' for colon-separated vars

Fixes #5809
2019-04-11 02:52:18 -07:00
Aaron Gyes
f086064d72 add --print-rusage-self to completions 2019-04-10 16:41:26 -07:00
Fabian Homborg
25dd22242d Adjust __fish_print_help for sphinx
This is beyond cheesy, but it seems to work.

Fixes #5782.
2019-04-10 18:20:25 +02:00
Artur Juraszek
cece4d81c1 completions/pinky: Prompt with users list 2019-04-10 12:46:36 +02:00
Mahmoud Al-Qudsi
49935f13df Add completions for git bisect
[ci skip]
2019-04-09 20:36:42 -05: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
Fabian Homborg
78931d78bd completions/git: Handle diff --cached
Fixes #5785.

[ci skip]
2019-04-06 21:45:17 +02:00
Fabian Homborg
8ff866b26b Add repaint-mode bind function
If we switch the bind mode, we add a "force-repaint" there just to
redraw the mode indicator.

That's quite wasteful and annoying, considering that sometimes the prompt can take
half a second.

So we add a "repaint-mode" function that just reexecutes the
mode-prompt and uses the cached values for the others.

Fixes #5783.
2019-04-01 15:59:39 +02:00
Fabian Homborg
0d72912641
Expand abbr explicitly (#5762)
* Add "expand-abbr" bind function

This can be used to explictly allow expanding abbreviations.

* Make expanding abbr explicit

NOTE: This accepts them for space only, we currently also do it for \n
and \r.

* Remove now dead code

We no longer trigger an abbr implicitly, so we can remove the code
that does it.

* Fix comment

[ci skip]
2019-04-01 15:59:15 +02:00
Aaron Gyes
469a8880aa correct 'bind' completions
--new-mode isn't even an option `bind` takes, and it
-m for -M.
2019-03-31 21:38:23 -07:00
Fabian Homborg
7aaa3b8553
Keep the order for $PATH and $MANPATH when reading /etc/paths (#5767)
* Keep the order for $PATH and $MANPATH when reading /etc/paths

Fixes #5456.
2019-03-30 19:25:09 +01:00
Fabian Homborg
1937e409f7 completions/find: Fix typo 2019-03-29 17:46:01 -05:00
Mahmoud Al-Qudsi
93b02dcec4 Don't use camcontrol in FreeBSD zpool completions
It requires root/su privileges to list devices, and we have a great
alternative that already produces the desired results.
2019-03-29 17:43:03 -05:00
Fabian Homborg
fc7d11d7b8 Update zpool completions to use string instead of grep 2019-03-29 17:37:26 -05:00
Fabian Homborg
21d8b465cc nextd/prevd: Print BEL instead of "Hit end of history"
That message is just hugely annoying.

Hat-tip to @floam and d524bad5f16b5a18c22fefe440.
2019-03-28 11:58:53 +01:00
Fabian Homborg
e2ce63ff62 functions/help: Adjust command paths to sphinx
We now build a separate page per-command in cmds/$cmd.html instead of
a section in the "commands.html" page.

See #5696.

[ci skip]
2019-03-27 12:46:51 +01:00
Fabian Homborg
2a51e42ee0 functions/help: Try harder to find a browser on WSL
We now try cmd.exe via $PATH and via a common location, wsl-open, and
an open command.

Fixes #5756.

[ci skip]
2019-03-27 09:06:11 +01:00
Fabian Homborg
248200520e functions/help: Prefer xdg-open/cygstart over open
Some systems like Debian have "open" as a symlink to "openvt" (for... historical
reasons).

See #5756.

[ci skip]
2019-03-27 09:06:11 +01:00
Fabian Homborg
77e71cfcb1 completions/git: Handle AM files
Fixes #5763.

[ci skip]
2019-03-24 17:12:36 +01:00
Fabian Homborg
22d9382646 completions/service: Remove useless helper function
[ci skip]
2019-03-24 16:59:49 +01:00
Fabian Homborg
5afd1336e8 functions/fish_npm_helper: Use physical pwd
This searched for package.json in any parent, so just like finding
.git and .hg directories it _needs_ to use the physical pwd because
that's what git/hg/yarn use.

In general, if you do _any_ logic on $PWD, it should be the physical
path. Logical $PWD is basically only good for display and cd-ing
around with symlinks.

[ci skip]
2019-03-24 10:49:04 +01:00
Fabian Homborg
25ba16d4b6 functions/help: Cleanup 2019-03-22 12:48:26 +01:00
Fabian Homborg
4c61691377 functions/help: Don't eval to check for lynx
This called `eval $fish_browser --version` to figure out if it is
lynx.

That's really not worth it just to support edge-cases using a rather
unusual browser, to work around a bug in it.

Instead we just see if the browser name starts with "lynx", which
should work in 99.9% of cases.
2019-03-22 12:38:23 +01:00
Fabian Homborg
21c8be8cd1 functions/help: Use open command everywhere
See #5756.

[ci skip]
2019-03-22 09:09:57 +01:00
Fabian Homborg
a649c5293e functions/fish_git_prompt: Fix space prefix for verbose showupstream
This created another local version of the variable just for the if-block.

Can't say I love the space prefix, but then I think we have too many
of these modes anyway.
2019-03-19 10:27:52 +01:00
Fabian Homborg
f6226f0802 functions/fish_git_prompt: Useful status for show_upstream
Returns 0 if there is no diversion, 1 otherwise.
2019-03-19 10:24:40 +01:00
Fabian Homborg
632c47be54 functions/fish_git_prompt: Remove literal tabs 2019-03-19 10:24:34 +01:00
Fabian Homborg
05ef157757 functions/fish_git_prompt: Let helper functions return useful status
If you use these to figure out if there _are_ staged files, or dirty
or whatever, you currently need to check the output, which relies on
the configured character.

Instead, we let them also return a useful status.
Notably, this is *not* simply the status of the git call.

__fish_git_prompt_X returns 0 if the repo is X.

This works for untracked, but the "diff" things return 1 if there is a
diff, so we invert the status for them.

See #5748.

[ci skip]
2019-03-19 10:11:37 +01:00
ykai
f56bce3f97 Fixed mount -o<TAB> exception 2019-03-19 09:28:14 +01:00
Fabian Homborg
805a8db7ef functions/fish_hg_prompt: Show untracked files
Apparently "status --quiet" actually inhibits showing untracked files,
which explains why it's 20% faster (though it's quite weird use of
that option!)

Fixes #5749.

[ci skip]
2019-03-18 22:26:43 +01:00
SanskritFritz
aea4062906 cower doesn't exist anymore, completions dropped 2019-03-17 10:55:01 +01:00
Fabian Homborg
0b6d6a29eb completions/git: Fix broken conditions for git config
Classic case of not seeing `and` as a new command:

`__fish_git_using_command config and anotherthing`

causes `and anotherthing` to be passed as arguments to
`__fish_git_using_command` instead of being executed.

[ci skip]
2019-03-15 20:09:55 +01:00
Fabian Homborg
a7ab8c6a4b Remove __fish_test_arg helper function
This was a remnant from before `string` existed, and was only used by
the xterm completions.

Part of #5279

[ci skip]
2019-03-15 19:58:01 +01:00
Fabian Homborg
2de3f7c686 Move ninja functions into ninja completions
Part of #5279

[ci skip]
2019-03-15 19:57:56 +01:00
Fabian Homborg
1c3c76165e Move xrandr functions into randr completions
Part of #5279.

[ci skip]
2019-03-15 19:57:51 +01:00
Fabian Homborg
a1380a736b Move __fish_print_make_targets into make completions
A function file for a function used only by one completion (and
unlikely to be used anywhere else).

If another user shows up, we can move it out again.

Part of #5279

[ci skip]
2019-03-15 19:57:46 +01:00
Fabian Homborg
86e9e60ae7 completions/set: Fix set -eU
This had a typo where it completed `-u` variables. Only `-u` means
unexported, `-U` means universal.

[ci skip]
2019-03-15 15:22:59 +01:00
Fabian Homborg
83932441bb Fix fish_clipboard_paste with string-replace-fewer-backslashes
This is the one place in fish where we use a `\` in the replacement of
a `string replace -r`, so we'll have to check the feature.
2019-03-15 15:18:19 +01:00
Fabian Homborg
a7a12c5c96
Merge pull request #5709 from zabereer/prompts_with_pipestatus
Prompts with pipestatus
2019-03-15 14:32:33 +01:00
Fabian Homborg
18d7123ff4 fish_git_prompt: Use count from stdin
Removes any uses of `wc` in our codebase.
2019-03-15 14:31:36 +01:00
Fabian Homborg
9dcb5abaf1 completions/pandoc: Stringify
This should be the last call to `grep` outside of a script
specifically related to `grep`.

(With the exception of `zpool`, which I've already written, but which
will probably be merged later)
2019-03-14 17:16:47 +01:00
Fabian Homborg
7766d0a7d0 Remove outdated comment
[ci skip]
2019-03-14 13:23:48 +01:00
Fabian Homborg
912ba177ec functions/__fish_append: Stringify
This called `sed`, twice.
2019-03-14 13:23:48 +01:00
Fabian Homborg
05038fc865 completions/zfs: Stringify 2019-03-14 13:23:47 +01:00
Fabian Homborg
aa08504fe3 completions/zpool: Stringify a bit
These are the simple bits - replace useless helper functions and uses
of grep/sed with string or other appropriate tools.
2019-03-14 13:23:47 +01:00