Commit Graph

13402 Commits

Author SHA1 Message Date
Ben Woods
c1ef9676cb completions/pkg: Add support for "pkg check" sub-command 2021-01-04 21:54:58 +01:00
Fabian Homborg
cb9029944e docs: Remove margin entirely on small screens
This removes the margin with the background gradient and such
completely once the screen falls under 700px. In those cases we really
don't want to waste space, and having just a weird blue bit above the
docs looks weirder than not having anything.
2021-01-04 21:53:30 +01:00
Fabian Homborg
0507b046ef completions/pkg: Only exit for Solaris, not everything-but-FreeBSD
In e8b6705067 this was made to exit if
not on FreeBSD because Solaris has a tool called "pkg" that apparently
"isn't worth supporting".

Since at least DragonflyBSD also uses FreeBSD's pkg thing, let's turn
that check around.
2021-01-04 17:25:50 +01:00
Edouard Lopez
7c704ce545 use original theme repo URL 2021-01-04 13:54:58 +01:00
Fabian Homborg
768defeb8e webconfig: Stop proscribing a specific font-family
There's a macOS bug with Source Code Pro that makes it unable to be
colored. Since that makes webconfig unusable, stop recommending it.

Instead, we just pick the default monospace font for the system.
2021-01-04 12:23:29 +01:00
Fabian Homborg
6eeb8861e7 Add exit bind function
Currently binding `exit` to a key checks too late that it's exitted,
so it leaves the shell hanging around until the user does an execute
or similar.

As I understand it, the `exit` builtin is supposed to only exit the
current "thread" (once that actually becomes a thing), and the
bindings would probably run in a dedicated one, so the simplest
solution here is to just add an `exit` bind function.

Fixes #7604.
2021-01-04 09:45:34 +01:00
Weihang Lo
4116aaeb5f Update rustc.fish
- [`-L`: add a directory to the library search path][1]
- [`--crate-type`: a list of types of crates for the compiler to emit][2]
- [`--emit`: specifies the types of output files to generate][3]

[1]: https://doc.rust-lang.org/stable/rustc/command-line-arguments.html#-l-add-a-directory-to-the-library-search-path
[2]: https://doc.rust-lang.org/stable/rustc/command-line-arguments.html#--crate-type-a-list-of-types-of-crates-for-the-compiler-to-emit
[3]: https://doc.rust-lang.org/stable/rustc/command-line-arguments.html#--emit-specifies-the-types-of-output-files-to-generate
2021-01-03 18:09:50 +01:00
Fabian Homborg
85ba2ed790 type: Add missing newline
Otherwise this would print

    # Defined interactivelyfunction foo

for interactively defined functions.
2021-01-03 17:48:25 +01:00
Fabian Homborg
627fff7971 webconfig: Comment utf-8 assumption 2021-01-03 15:48:39 +01:00
Fabian Homborg
17501bcc57 webconfig: Error out on form-data
Just in case this happens anywhere return a sensible error instead of
mishandling it.
2021-01-03 15:27:46 +01:00
Fabian Homborg
cb3ee51e08 CHANGELOG cgi removal 2021-01-03 15:18:15 +01:00
Fabian Homborg
e332555596 Webconfig: Remove dependency on cgi module
This is slated for removal in python 3.10, see
https://www.python.org/dev/peps/pep-0594/#cgi.

We currently only use it for three things:

- escape_html in old python versions that didn't have that in the html
  module
- Parsing multipart/form-data
- Figuring out the charset for json

We keep the first one - if loading escape_html from html fails we fall
back to cgi.

We remove the second - I can't find any case where we use
multipart/form-data. Any place we post data we either explicitly pass
application/x-www-form-urlencoded or implicitly use application/json.

The third is the tricky bit. This drops charset detection under the
assumption that we're never going to encounter anything other than
utf-8 (or ascii, which is a utf-8 subset). I'm not sure that holds,
but if it doesn't we can just add a regex to parse the charset.
2021-01-03 15:16:47 +01:00
Ilan Cosman
18940ea086
Remove dunderscores from __fish_status_to_signal (#7597)
* Remove dunderscores from __fish_status_to_signal

* Document fish_status_to_signal

* CHANGELOG: Add fish_status_to_signal

* Add string join to fish_status_to_signal documentation example
2021-01-03 15:15:57 +01:00
ridiculousfish
29121ffc4c Relnote fixes for #7589 and #1383 2021-01-02 22:18:14 -08:00
ridiculousfish
118f710e99 Allow fish_private_mode to change at runtime
Prior to this change, `fish_private_mode` worked by just suppressing
history outright. With this change, `fish_private_mode` can be toggled on
and off. Commands entered while `fish_private_mode` is set are stored but
in memory only; they are not written to disk.

Fixes #7590
Fixes #7589
2021-01-02 22:01:47 -08:00
ridiculousfish
9fdc4f903b Explicitly track persistence mode in history_item_t
Commands that start with a space should not be written to the history
file. Prior to this change, that was implemented by simply not adding them
to history. Items with leading spaces were simply dropped.

With this change, we add a 'history_persistence_mode_t' to
history_item_t, which tracks how the item persists. Items with leading
spaces are now marked as "ephemeral": they can be recovered via up arrow,
until the user runs another command, or types a space and hits return.
This matches zsh's HIST_IGNORE_SPACE feature.

Fixes #1383
2021-01-02 21:31:19 -08:00
ridiculousfish
cdf05325ed Reorganize history_item_t
Move the private bits to the bottom of the class and other mild
refactoring. No user visible behavior change expected.
2021-01-02 19:51:16 -08:00
David Adam
ab5608ddf2 CHANGELOG: work on 3.2.0 2021-01-02 23:26:58 +08:00
Fabian Homborg
f547c2fda8 Webconfig: Fix customizing ayu themes
These used a different object format, so they were passed to
interpret_color wrong.

Because the "common" and "syntax" division doesn't really help all
that much, let's just flatten the thing.

See #7596.
2021-01-02 16:22:12 +01:00
Fabian Homborg
cf8219e3ce Exit if --no-execute is enabled don't interactively read from the terminal
Don't go into implicit interactive mode without ever executing
anything - not even `exit` or reacting to ctrl-d. That just renders
the shell useless and unquittable.
2021-01-01 21:22:52 +01:00
Fabian Homborg
eb43fc83c5 CHANGELOG: Add that numbered debugging is no more 2021-01-01 20:47:23 +01:00
Fabian Homborg
8a585bb711 Also disable winch handling in alacritty
It also reflows.

We might want to think about doing something more extensible here, as
konsole is also about to add reflow, but for now the main problem
children here are VTE and alacritty.

Extends #7491.
2021-01-01 20:22:57 +01:00
Fabian Homborg
364692fa3d CHANGELOG: MOAR 2021-01-01 18:38:20 +01:00
Fabian Homborg
b43a8688fe docs: Correct argparse on short- options
These aren't exposed as variables at all, so it's just entirely
vestigial now and only kept for backwards compatibility.
2021-01-01 14:22:22 +01:00
Fabian Homborg
164a5ebe81 tests: Remove unused colordiff function 2021-01-01 14:18:17 +01:00
Fabian Homborg
57d23c390b docs: Reword argparse a bit
In particular use "variable" instead of "var".
2021-01-01 14:03:00 +01:00
Johannes Altmanninger
9231956f62 CHANGELOG: document some changes with no associated issue
This should cover my remaining user-facing commits since 3.1.2.
2021-01-01 12:20:37 +01:00
Fabian Homborg
5c09a6d91e CHANGELOG: Missed one ayu colorscheme
*Ozzy voice* I'm going through CHANGELOGs
2021-01-01 12:19:12 +01:00
Fabian Homborg
8ffa440936 More CHANGELOG
Changelog, dub dub dub CHANGELOG, dibbie dab dab CHANGELOG
2021-01-01 11:39:41 +01:00
Fabian Homborg
7ea8e20623
argparse: Make short flag names optional (#7585)
It was always a bit ridiculous that argparse required `X-longflag` if
that "X" short flag was never actually used anywhere.

Since the short letter is for getopt's benefit, we can hack around
this with our old friend: Unicode Private Use Areas.

We have a counter, starting at 0xE000 and going to 0xF8FF, that counts
up for all options that don't have a short flag and provides one. This
gives us up to 6400 long-only options.

6.4K should be enough for everybody.
2021-01-01 11:37:25 +01:00
Edouard Lopez
c8b400bfad register ayu colorscheme 2021-01-01 11:36:13 +01:00
Edouard Lopez
9272703359 add ayu colorscheme 2021-01-01 11:36:13 +01:00
ridiculousfish
792abf61ec Attempt to fix the tsan build
Deliberately leak the shared thread pool to avoid shutdown dtor registration
and tsan complaints at exit.
2020-12-31 17:03:53 -08:00
ridiculousfish
66c2266ed1 Correct a changelog 'issue' template to remove the hash
This fixes an 'Invalid issue number' warning.
2020-12-31 16:34:04 -08:00
David Adam
bdb99168f0 CHANGELOG: work on 3.2.0 2020-12-31 22:06:25 +08:00
ridiculousfish
f03ff8cd00 Add a test for history path detection
This will support history path detection improvements in a future
commit.
2020-12-30 00:44:25 -08:00
Johannes Altmanninger
686d64cf05 Disable some clang-tidy lints with false positives
One warns about using system() which we only use in test code (we're all adults):

	src/fish_tests.cpp:2015:9: warning: calling 'system' uses a command processor [cert-env33-c]
	    if (system("mkdir -p test/fish_expand_test/bb/")) err(L"mkdir failed");

Some conversion warnings that don't seem very useful:

	src/input_common.cpp:181:20: warning: 'signed char' to 'wint_t' (aka 'unsigned int') conversion; consider casting to 'unsigned char' first. [cert-str34-c]
	        wint_t b = evt.get_char();

Warning about varargs doesn't make sense, because some of our functions use std::vswprintf() internally.

	src/ast.cpp:486:10: warning: do not define a C-style variadic function; consider using a function parameter pack or currying instead [cert-dcl50-cpp]
	    void internal_error(const char *func, const wchar_t *fmt, ...) const {

Finally, what seems like a false positive; "va" is initialized by va_copy:

	src/common.cpp:468:18: warning: Function 'vswprintf' is called with an uninitialized va_list argument [clang-analyzer-valist.Uninitialized]
	        status = std::vswprintf(buff, size / sizeof(wchar_t), format, va);
2020-12-29 16:31:43 +01:00
Johannes Altmanninger
801955851b Workaround clang-tidy incorrectly assuming null
This silences a false positive linter warning about a null dereference.
2020-12-29 16:31:43 +01:00
Johannes Altmanninger
8fc9b9d61b Address some minor lints
A mildly interesting one is the call to test_wchar2utf8 with a non-null
pointer ("u1"/"dst") but 0 length. In this case we relied on malloc(0)
returning non-null which is not guaranteed.

	src/fish_tests.cpp:1619:23: warning: Call to 'malloc' has an allocation
	size of 0 bytes [clang-analyzer-optin.portability.UnixAPI]
	        mem = (char *)malloc(dlen);
	                      ^
	test_wchar2utf8(w1, sizeof(w1) / sizeof(*w1), u1, 0, 0, 0,
			"invalid params, dst is not NULL");
2020-12-29 16:31:43 +01:00
Johannes Altmanninger
a205225b4e lint.fish: properly handle -I and -D args for cppcheck
lint.fish receives arguments that contain multiple includes and defines.
As a result, we passed arguments like
"-I/usr/include -I$HOME/fish-shell/build -I/usr/include"
to cppcheck which interprets this as a single include directory.
This leads to errors like this one (because the "build" dir was missing):

	src/common.h:4:0: information: Include file: "config.h" not found. [missingInclude]
2020-12-29 16:31:43 +01:00
Johannes Altmanninger
f0f5724e18 CONTRIBUTING: Debian provides a "clang-format" package 2020-12-29 16:31:43 +01:00
Johannes Altmanninger
39a3aa0c2d CONTRIBUTING: shorten and remove stale description
We do use "// clang-format off" (once).
2020-12-29 16:31:43 +01:00
Johannes Altmanninger
ad3b76eeb7 CONTRIBUTING: stop recommending deprecated Vim plugin
The description on the plugin page says "!!!Deprecated!!!".
2020-12-29 16:31:43 +01:00
Johannes Altmanninger
53d922bde6 build_tools/lint.fish: correct cppcheck config location
Which was moved in 9b3bfb63d ("cppcheck: Move config files to build_tools")
Also get rid of the nonstandard cppcheck output format.
2020-12-29 16:31:43 +01:00
Johannes Altmanninger
69a9785f50 Refactor: pass by value, not reference, to enable move semantics
clang-tidy wrote:
> warning: passing result of std::move() as a const reference argument;
> no move will actually happen [performance-move-const-arg]
2020-12-29 16:31:43 +01:00
Johannes Altmanninger
c890982c90 GNUMakefile: remove redundant CMake arguments 2020-12-29 16:31:43 +01:00
Johannes Altmanninger
a24ceaf0df completions/git: offer ranges for cherry-pick 2020-12-29 16:31:43 +01:00
Johannes Altmanninger
85830a5775 completions/git: don't sort branches and tags
This seems a bit more intuitive.
2020-12-29 16:31:43 +01:00
Johannes Altmanninger
84262b126b build_tools/style.fish: don't format other Python files 2020-12-29 16:31:43 +01:00
Fabian Homborg
4c09012b0d tests: Don't rely on $HOME existing
Apparently the launchpad tests run with $HOME set to a nonexistent
directory. Since we just want *out*, let's just store the previous dir
and go back.
2020-12-29 12:48:11 +01:00