Commit graph

6484 commits

Author SHA1 Message Date
Fabian Homborg
a070dffc4e Merge pull request #3666 from drwilly/master
mixed bag of shell scripting improvements
2017-01-06 16:10:03 +01:00
Kurtis Rader
f0515d0caa improve wording of error message
Zanchey proposed this improved wording in feedback to PR #3658.
2017-01-05 12:09:29 -08:00
Fabian Homborg
1f836f72b3 pushd: Use $PWD instead of command pwd
Useless forks.
2017-01-05 01:49:44 +01:00
dareg
89e48ba0b3 Add completion for the changelog subcommand 2017-01-03 20:59:18 -08:00
Kurtis Rader
b118ed69d3 convert narrow stderr output to wide forms
On some platforms, notably GNU libc, you cannot mix narrow and wide
stdio functions on a stream like stdout or stderr. Doing so will drop
the output of one or the other. This change makes all output to the
stderr stream consistently use the wide forms.

This change also converts some fprintf(stderr,...) calls to debug()
calls where appropriate.

Fixes #3692
2017-01-03 16:14:42 -08:00
Oliver Gondža
dddbdddcff Avoid using empty description for complete in maven completion 2017-01-03 16:57:12 +01:00
Kurtis Rader
05f19ad09c clarify autoloading and aliases
Another dev pointed out my previous attempt to resolve issue #3612 did
not do a good job of clarifying the matter. Hopefully this change is
better at explaining why autoloading is not applicable to aliases.
2017-01-02 17:15:18 -08:00
Kurtis Rader
7211802fc0 silence unused parmeter warning 2017-01-01 21:48:40 -08:00
Dale Eidd
7b906134e2 Fix commandline selection including extra character
Fixes #3684
2017-01-01 13:57:31 -08:00
Aaron Gyes
1fb92b6f8c Use new set_color features for __fish_cancel_commandline
We still apparently need to rely on tput for 'el'.
2016-12-31 06:12:05 -08:00
Anders Rasmussen
b22842a52f Add italics, dim, reverse video to set_color (#3650)
* Add italics and dim modifier to set_color

* update documentation for set_color

* add reverse mode to set_color

* Use standout mode as fallback for reverse mode

* Apply patch from @Darkshadow2 adding additional modes
2016-12-30 11:33:25 -08:00
Vedant Nevetia
834fdf8666 Fix job_t variable name inconsistency (#3685) 2016-12-29 16:09:52 -08:00
Kurtis Rader
1621fa43d8 don't mix narrow and wide stdio
Fixes #3686
2016-12-29 12:24:56 -08:00
Fabian Homborg
3da3558e35 Remove eval in __fish_complete_proc
This was completely useless.
2016-12-29 15:35:19 +01:00
Fabian Homborg
b29b026106 math: Set BC_LINE_LENGTH to a very high number
This means we no longer have to do manual stitching which improves performance.
2016-12-29 15:13:48 +01:00
Fabian Homborg
7ffcb828fe Add test for long numbers in math
This should catch the error in 26e781ef5a.
2016-12-29 14:00:15 +01:00
Fabian Homborg
11f4e64e45 Revert "Use BC_LINE_LENGTH=2 for bc."
This would fail on very long numbers, e.g.

`math "1 + 1233242342353453463458972349873489273984873289472914712894791824712941"`

would now return "42", where it previously returned the correct "1233242342353453463458972349873489273984873289472914712894791824712942".

This reverts commit 26e781ef5a.
2016-12-29 13:53:11 +01:00
Fabian Homborg
bd93a9e6ff Remove useless-use-of-echo in git_prompt 2016-12-29 13:49:21 +01:00
Aaron Gyes
aed5267fd1 Stringify __fish_git_prompt 2016-12-29 04:11:23 -08:00
Aaron Gyes
26e781ef5a Use BC_LINE_LENGTH=2 for bc.
It's not the case that macOS and old BC doesn't respect this environment
variable, just that they don't have special behavior when it's set to 0.
However, there is rather universal favorable behavior with a value of 2.

Output is of the form:
\
999999999999999999999999999999999...

with the second line being arbitrarily long. So just grab that line
instead of stitching with `string`.

This can yield a 25-30% speedup.
2016-12-29 03:47:37 -08:00
Kurtis Rader
ee6691458e clarify that aliases are not autoloaded
Fixes #3612
2016-12-28 19:44:25 -08:00
Samantha Marshall
4cd34816cf Adding subcommand completions for launchctl 2016-12-28 18:39:25 +01:00
Radomír Bosák
f9835b5077 Add support for subcommands in __fish_man_page
This commit adds a feature that after typing "git add" and pressing
"alt+h", the manpage for "git-add" instead of "git" would be displayed.

The new logic takes the first argument which doesn't start with a dash
and tries to display manpage for "command-argument"; it falls back to
"man command" it the first try doesn't succeed.

Fixes #3618.
2016-12-27 16:03:21 -08:00
Zoltán Mizsei
52c7ebe502 Haiku needs _BSD_SOURCE and <bsd/ifaddrs.h> 2016-12-27 16:00:13 -08:00
Sam H
6b536922af Append paths from /etc/manpaths and /etc/manpaths.d/* to MANPATH, for #1092.
* Only append paths if `MANPATH` is already set, to match behavior of macOS
     `path_helper` utility.
   * Use the same technique as is used above to set PATH from /etc/paths and
     /etc/paths.d/*.
2016-12-27 14:21:36 -08:00
Kurtis Rader
574424dc5a fix uvar tests
I noticed that universal variable tests were failing on Cygwin and
Dragonfly BSD. The failures were because we are attempting to verify the
correct behavior of mechanisms that are known to be broken on those
platforms. There are still uvar test failures on those platforms with
this change but they are due to actual problems rather than bugs in the
tests.

Fixes #3587
2016-12-25 21:17:27 -08:00
Zoltán Mizsei
aedee4e1a4 Haiku have no lsocket, but lnetwork 2016-12-26 08:00:53 +08:00
Kurtis Rader
f31f53f61f fix random.1 man page
Trailing whitespace on a `\fish` command was causing this build failure:

/private/var/folders/T/fish_doc_build_3RT8yS/random.doxygen:44:
   warning: found </pre> tag without matching <pre>
2016-12-24 13:52:49 -08:00
Kurtis Rader
7c40abe4a6 switch from \1xb to \e in the code
Using `\e` is clearer and shorter than `\x1b`. It's also consistent with how
we write related control chars; e.g., we don't write `\x0a` we write '\n'.
2016-12-24 12:15:28 -08:00
Kurtis Rader
58347d494a update PROMPT_SP heuristic
Update our implementation of the PROMPT_SP heuristic to match current
zsh behavior. This makes it behave better on terminals like ConEmu and
the native MS Windows console which automatically insert a newline when
writing to the last column of the line.

Fixes #789
2016-12-24 12:14:32 -08:00
Kurtis Rader
01dbfb0a3f replace writestr() with fwprintf() in reader.cpp
There are several places that use writestr() which should instead be
using fwprintf() or equivalent. Also, clarify the documentation for why
writestr() and writechr() exist so they aren't used inappropriately
again.

Fixes #3657
2016-12-23 19:24:44 -08:00
Terje Larsen
2740cc80d2 improve make target completion
- Support completing dynamic make targets.
- Support completing make targets when using -C/--directory.
- Support `-Cdir/path`, `-C dir/path`
- Support `--directory=dir/path`, `--directory dir/path`

This detects if the make command have the `-p` switch otherwise it
assumes it is BSD make and will run a different command to try to figure
out the available targets.
2016-12-21 19:04:15 -08:00
Kurtis Rader
8ba2a4cfd4 fix race opening the uvar pipe
Fixes #3426
2016-12-21 16:32:43 -08:00
Kurtis Rader
1f2432d63a reinstate VBox* completions
Commits 48aa92900 and 77d4d21ca each added two files with the same name
differing only in letter case. That causes problems on systems like
macOS and MS Windows. Remove the lowercase file names. Anyone needing
those completions can do (same for VBoxHeadless):

function vboxsdl --wraps VBoxSDL
    VBoxSDL $argv
end
2016-12-21 16:03:32 -08:00
ridiculousfish
a70ed0282b Revert "Add VBoxSDL completions"
This commit confused git on case-insensitive HFS+

This reverts commit 48aa929008.
2016-12-21 15:53:51 -08:00
ridiculousfish
a7e3678d3e Revert "Add VBoxHeadless completions"
This commit confused git on case-insensitive HFS+

This reverts commit 77d4d21caa.
2016-12-21 15:53:38 -08:00
ridiculousfish
dce9453d25 Add a new completion test for optional arguments 2016-12-21 15:46:46 -08:00
Wilke Schwiedop
fa7682ec3c posixify! 2016-12-21 18:47:04 +01:00
Wilke Schwiedop
28cde83c33 requested changes 2016-12-21 18:44:34 +01:00
Clément Martinez
96157a05f6 Update fish_indent completions 2016-12-21 14:51:48 +01:00
Clément Martinez
b9f0842d7e Add base64 completions 2016-12-21 14:51:48 +01:00
Clément Martinez
77d4d21caa Add VBoxHeadless completions 2016-12-21 14:51:48 +01:00
Clément Martinez
48aa929008 Add VBoxSDL completions 2016-12-21 14:51:48 +01:00
Clément Martinez
291a28e79c Add __fish_print_VBox_vms function
Improve __fish_print_VBox_vms
2016-12-21 14:51:48 +01:00
Clément Martinez
6ab97227de Add objdump completions 2016-12-21 14:51:48 +01:00
Clément Martinez
6dec6ddc26 Fix netctl-auto completions 2016-12-21 14:51:48 +01:00
Clément Martinez
0785260365 Fix pygmentize completion
The previous implementation didn't take into account that a lexer could
have multiple names and gave `cpp, c++` instead of `cpp` and `c++` when
completing `pygmentize -l c`.
2016-12-21 14:51:42 +01:00
Clément Martinez
885de80a0e Add feh completions 2016-12-21 14:45:02 +01:00
Wilke Schwiedop
8204d3103b fix gpg completion 2016-12-21 13:46:43 +01:00
Wilke Schwiedop
0814797444 misc improvements to scripts 2016-12-21 13:46:43 +01:00