Commit Graph

15439 Commits

Author SHA1 Message Date
Aaron Gyes
ab353ce0e4 common.h: use emplace in vec_append 2021-12-20 22:54:59 -08:00
Aaron Gyes
9abbcc0ba6 ast.cpp: initialization order
member 'extras_' is used to initialize 'tokens_'.
members are initialized in the order they are declared in a class
2021-12-20 22:43:58 -08:00
Johannes Altmanninger
5211735965 benchmarks/driver.sh: also quote path to benchmarks
I had only tested with a space in the path to the fish binary, but
not with a space in the path to the repository.

Closes #8559
2021-12-20 06:48:00 +01:00
Aaron Gyes
70f2899fcd .gitattributes: rig the count
This is a dishonest change that classifies our completion scripts
as a type of documentation, which should prevent share/completions
contributing to the language breakdown as shell scripts.

Goal here is for fish-shell to be classified C++ on GitHub.

Prior to commit:

Shell     57.1%
C++       38.3%
Python     3.0%
CMake      0.7%
JavaScript 0.4%
HTML       0.2%
Other      0.3%
2021-12-19 18:58:30 -08:00
Aaron Gyes
5e8c9de631 .gitattributes: * is not recursive, ** is. Add missed paths
You can see attributes set on a particular file with
    git check-attr -a PATH
2021-12-19 18:46:12 -08:00
Johannes Altmanninger
a078a56492 CHANGELOG: don't mention completions/man fix for BSD mandoc
This is just a fix to an existing completion entry, we usually don't
mention those.
2021-12-19 15:15:46 +01:00
Johannes Altmanninger
db7bea1a3e benchmarks/driver.sh: quote path to fish if necessary
To allow paths with spaces, give a shell-quoted path to hyperfine. We
could make this a bit shorter by quoting as early as possible, like

	FISH_PATH=$(quote "$1")

and then use $FISH_PATH unquoted. I discarded that idea because it
probably looks surprising.

Closes #8559
2021-12-19 11:51:45 +01:00
ridiculousfish
0d67dd19a1 Switch path_get_data_is_remote to returning a real class enum
End the tricky use of maybe_t<bool> by using a real class enum.
2021-12-18 20:48:13 -08:00
Fabian Homborg
086d388932 Also read /etc/default/locale for the locale
Apparently a thing on Debian systems (whyyyyy)

Fixes #8557
2021-12-18 08:57:22 +01:00
Aaron Gyes
ca6e9f9fe7
README.rst: fix badge
The name of the main workflow changed to "test" a while back, and then "make test" after that.
2021-12-17 16:12:08 -08:00
Aaron Gyes
461facb42e History: adjust description entries 2021-12-17 15:44:05 -08:00
Aaron Gyes
5ae7bc1443 help: adjust synopsis. history manpage: indent long synopsis lines 2021-12-17 15:38:49 -08:00
Aaron Gyes
50d65ace34 fixup 2021-12-17 15:23:02 -08:00
Aaron Gyes
4c6da2091d Harmonize some idiosyncrancies introduced
For now, we are going with ``command`` for builtins and fish scripts,
and **keyword** for parser keywords like if or and.
2021-12-17 15:20:46 -08:00
Aaron Gyes
af61ea1325 doc_src: Continue the slog through the letter F.
We are using only :: in a synopsis for fishscript examples given
of the command being documented.
2021-12-17 15:16:47 -08:00
Aaron Gyes
5e880bb1c3 Commit doc_src progress.
This is continuing the work I've been doing to remove the ::
formatting for the synopsis sections of our manual pages.
2021-12-17 13:59:39 -08:00
David Adam
4389658e7b CHANGELOG: work on 3.4.0 2021-12-15 22:58:53 +08:00
Emily Grace Seville
077f1f2576 Redirect stderr of xclip to /dev/null
xclip will display an error when pasting if the clipboard contains
something that isn't text:
  Error: target STRING not available

Swallow this error.
2021-12-15 22:30:12 +08:00
Johannes Altmanninger
1d1bee3ba2 CHANGELOG: some updates for 3.4.0
I used the command from #8092 to list issues/PRs with missing changelog
entries, and went through most of them and added them to the changelog
(or the "ignore" list).

This commit message lists the processed issues in a consistent format,
and lists the action/reason. For each issue/PR there are twolines:
- Issue/PR number + subject
  - (I used bare issue numbers to avoid cross-referencing on github).
- verdict
  - "added new entry" means that we add a changelog line
  - "added to existing entry" means that we added the issue link to an existing
     changelog line. Usually we don't add multiple issue links, but sometimes
     there are multiple interesting issues.
  - if the verdict ends with ", ignoring", we added it to the "ignore" list in
    the changelog.

The issues are grouped by verdict, with the interesting/leftover ones
on top.

The "gh" script is already a quantum leap but we should still find
better ways to share the burden of writing the changelog.
I noticed that there are many minor updates that can probably be
ignored.  Filtering them out doesn't take much time but it adds up,
especially if it's a single person doing it.

Here's the adapted script I used:

	for issue in (gh issue list --state closed --milestone "fish 3.4.0" -L 500 | sort -n | cut -f 1)
	    egrep --quiet '\W'$issue CHANGELOG.rst; or echo https://github.com/fish-shell/fish-shell/issues/$issue
	end
	for pr in (gh pr list --state all --search "milestone:\"fish 3.4.0\"" -L 500 | sort -n | cut -f 1)
	    egrep --quiet '\W'$pr CHANGELOG.rst; or echo https://github.com/fish-shell/fish-shell/pull/$pr
	end

---

Issue 8153: Work around `setpgid` error on older Apple platforms
workaround for old OSs for which we've since dropped support, ignoring

Issue 8511: math: (n n): incorrect error
improved error output, which is very nice but too minor, ignoring

Issue 8205: Fish autocomplete error on iOS procursus
niche fix, ignoring

Issue 8271: Fix `fish_key_reader` wrapper check
minor update to not create a harmless alias for fish_key_reader, ignoring

Issue 8289: funced dosn't like backslash escapes in function names
minor escaping fix, ignoring

Issue 8310: Hide whatis database building from the user
not something many users would notice in the first place, ignoring

Issue 8368: Duplicated "Type 'help argparse' for related documentation" for argparse
minor update to error message, ignoring

Issue 8444: Variable highlight color does not span lines
very obscure fix, ignoring

Issue 8195: Errors when trying to autocomplete (invalid) UTF-8 escapes
niche fix, ignoring

Issue 8308: assertion normal_exited() failed related to paged builtin help
niche fix, ignoring

Issue 8358: sigsegv on set --show variable (when LANG is set to fr_FR.utf8)
niche(?) fix, ignoring

Issue 8170: Builtin math ncr can be extremely slow
performance improvement only when the input is NaN, ignoring

Issue 8204: Always use LC_NUMERIC=C internally
performance improvement for math, ignoring

---

Issue 8295: Add --function to `read`
added to existing entry (565)

Issue 8283: Added completions for ethtool
added to existing entry

Issue 8315: Add dart completion
added to existing entry

Issue 8330: Add common lisp completions(sbcl/roswell)
added to existing entry

Issue 8354: Fix st issue with shift+tab
added to existing entry (8352)

Issue 8391: Support vi-mode cursors in Foot Terminal 
added to existing entry (8167)

Issue 8405: Completions pager should redraw if the subbed completion wraps/unwraps the line
added to existing entry (8509)

---

Issue 8530: Speed up, fix fish_status_to_signal 8530
added new entry

Issue 8547: command -v nonexistent should exit 127
added new entry

Issue 8431: Abbr -q return status inconsistent
added new entry

Issue 8428: Binding escape as user binding breaks escape sequence bindings (arrows, etc)
added new entry

Issue 8483: Windows "color" command completion
added new entry

Issue 8087: Doesn't build when using netbsd curses on Linux
added new entry

Issue 8152: Don't override linker
added new entry

Issue 8156: Add completions for `git-sizer`
added new entry

Issue 8163: `d3ceba107e88b6c6e1a0358ebcb30366aeef653f` causes issues with repainting multi-line prompt
added new entry

Issue 8175: Completion sometimes missing the last token
added new entry

Issue 8179: `set -S` should mark read-only variables
added new entry

Issue 8209: Slow interaction between backgrounding, universal variables, and repainting
added new entry

Issue 8274: Unsetting `$fish_emoji_width` doesn't clear the cached width
added new entry

Issue 8298: If prompt ends in an empty line, the commandline is inserted at the width of the line before
added new entry

Issue 8309: colors don't kick in for ls on macOS Big Sur, Monterey (and maybe FreeBSD)
added new entry

Issue 8337: Adds sub-command clear-session to history command. Issue 5791
added new entry (as 5791)

Issue 8352: Fix delete-key in st
added new entry

Issue 8373: Add clasp completion
added new entry

Issue 8434: argparse completions
added new entry

Issue 8510: fish_key_reader ^C warning isn't right
added new entry

Issue 8519: Use `--almost-all` in `la` function
added new entry

---

Issue 1363: improve the experience of using fish over mosh
listed as 8376, ignoring

Issue 8305: incomplete man page completions
listed as 8309, ignoring

Issue 8059: Support "$(cmd)" command substitution without line splitting
listed as 159, ignoring

Issue 8127: fish_config: Read colorschemes from .theme files
listed as 8132, ignoring

Issue 8130: funced: edit the whole file, not just the function definition
listed as 391, ignoring

Issue 8270: builtin cd: print error about broken symlink
listed as 8264, ignoring

Issue 8306: fix man completion for BSD's mandoc
listed as 8305, ignoring

Issue 8441: Don't escape tildes that come from custom completions
listed as 8441, ignoring

---

Issue 8429: `cargo run --example` completions break with nested example directories
update to existing completions, ignoring

Issue 8446: Use `cargo run --example` to get list of examples
update to existing completions, ignoring

Issue 8338: Display local branches before unique remote branches in git completion
update to existing completions, ignoring

Issue 8118: Node completion: add v8 sparkplug option
update to existing completions, ignoring

Issue 8183: Add zypper subcommands completion
update to existing completions, ignoring

Issue 8184: completion nmap: suppress warning when local scripts folder exists
update to existing completions, ignoring

Issue 8191: add missing `git commit` completions
update to existing completions, ignoring

Issue 8192: Updated ping completions
update to existing completions, ignoring

Issue 8202: Add `--function` to `set` completion
update to existing completions, ignoring

Issue 8219: completion: support `--no` prefixes for mpv flag options
update to existing completions, ignoring

Issue 8241: complete "mpc load"
update to existing completions, ignoring

Issue 8243: Add and fix completions for new options
update to existing completions, ignoring

Issue 8249: Fix completions/ls.fish
update to existing completions, ignoring

Issue 8256: Fix completions/coredumpctl.fish and add new complete
update to existing completions, ignoring

Issue 8311: completions/git: Handle "1 .T" & "1 AT" files
update to existing completions, ignoring

Issue 8323: completions/xbps-query: add missing `-p` completions
update to existing completions, ignoring

Issue 8326: Update ldapsearch.fish
update to existing completions, ignoring

Issue 8327: small fix completions/duply.fish
update to existing completions, ignoring

Issue 8334: Update ip.fish
update to existing completions, ignoring

Issue 8344: Fix ant completion
update to existing completions, ignoring

Issue 8365: Update dmesg completions
update to existing completions, ignoring

Issue 8367: No hints for -g|--global and -U|--universal flags for abbr command
update to existing completions, ignoring

Issue 8381: Updated systemd-analyze completions
update to existing completions, ignoring

Issue 8406: vmctl completion function call needs to be quoted
update to existing completions, ignoring

Issue 8480: pabcnetcclear command completion update
update to existing completions, ignoring

---

Issue 8495: Stop linking to StackOverflow
doc update, ignoring

Issue 8176: document `--no-config`
doc update, ignoring

Issue 8260: Theme demo needs to be adjusted so that only unmatched quote is an error
doc update, ignoring

Issue 8380: no error about wrong >>? redirection operator
doc update, ignoring

Issue 8385: set -l works outside of command block
doc update, ignoring

Issue 8409: Some enhancements to "for" and "while" loop pages
doc update, ignoring

Issue 8439: Html docs: Remove link underlines again?
doc update, ignoring

Issue 8457: Old-style options support "=" assignment operator in complete builtin
doc update, ignoring

Issue 8522: Document prompt_hostname
doc update, ignoring

---

Issue 8221: edit_command_buffer: use "command" to ignore any functions with the same name
only helps broken systems, ignoring

Issue 8287: Prepend command to cat
only helps broken systems, ignoring

Issue 8299: Make less version check compatible with older Fish
only helps broken systems, ignoring

Issue 8487: fish_config doesn't work without curses module
only helps broken systems, ignoring

---

Issue 8128: fix 'socket file name too long' error
test fix with long tempdirs (macOS), not really user-visible, ignoring

Issue 8449: Give tests a more generic name
not user-visible, ignoring

Issue 8353: string tests sometimes failing on macOS (Github Actions)
not user-visible, ignoring

Issue 6477: history merge test fails on OpenBSD
not user-visible, ignoring

---

Issue 8471: Obtain Deno completions from itself
update to an unreleased feature (7138), ignoring

Issue 8253: `string length --visible` performance
update to an unreleased feature, ignoring

Issue 8277: Backspace character is ignored when calculating string widths
update to an unreleased feature, ignoring

Issue 8314: `fish_config choose` leaves previous right prompt in place
update to an unreleased feature, ignoring

Issue 8394: parenthesis characters outer of $(command substitution) in string cause error
update to an unreleased feature, ignoring

Issue 8500: Parser bug with command substitutions in strings inside parenthesis
update to an unreleased feature, ignoring

Issue 8419: fish_config: silently doesn't set color schemes.
regression, not in any release, ignoring

Issue 8438: :program: in sphinx doesn't link
regression, not in any release, ignoring

Issue 8478: __fish_seen_argument.fish throws exception when autocompleting
regression, not in any release, ignoring

---

Issue 8280: Fix typo in abbr docs
typofix, ignoring

Issue 8321: Fix typo in `set_colors` command documentation
typofix, ignoring

Issue 8257: Typo funcions -> functions
typofix, ignoring

---

Issue 8206: remove make_pair
no behavior change, ignoring

Issue 8222: replace push_back with emplate_back
no behavior change, ignoring

Issue 8224: clang-tidy: remove pointless virtual
no behavior change, ignoring

Issue 8227: change value to rvalue reference
no behavior change, ignoring

Issue 8228: convert const ref to rvalue ref
no behavior change, ignoring

Issue 8229: clang-tidy: use for range loops
no behavior change, ignoring

Issue 8230: fix deleted constructors
nno behavior change, ignoring

Issue 8231: clang-tidy: const reference conversions
no behavior change, ignoring

Issue 8235: clang-tidy: simplify two bool returns
no behavior change, ignoring

Issue 8237: clang-tidy: replace size comparisons with empty
no behavior change, ignoring

Issue 8239: clang-tidy: replace NULL with nullptr
no behavior change, ignoring

Issue 8252: add constexpr
no behavior change, ignoring

Issue 8430: __fish_seen_subcommand_from and __fish_seen_argument update
no behavior change (apart from a regression that's fixed), ignoring

Issue 8476: Run fish_indent on all non-test .fish files
no behavior change, ignoring

Issue 8477: Use test command instead of bracket command
no behavior change, ignoring

Issue 8521: Fix code scanning alert - Wrong type of arguments to formatting function
no behavior change, ignoring

Issue 8236: clang-tidy: replace push_back with emplace_back
no behavior change, ignoring

---
2021-12-15 22:18:16 +08:00
Johannes Altmanninger
f88e8260ca CHANGELOG: commandline -> command line
"commandline" is usually the term we  use in source code, and it's
also a builtin but user visible text should be English.
2021-12-15 22:18:16 +08:00
Fabian Homborg
67dc86cfa4 webconfig: Skip colors not named in a theme
This is a stop gap. Ideally setting a theme would be idempotent. You
set it, all colors change to match it, even the ones it does not
specify.

However, I do not believe we can *erase* colors that aren't set, and
we don't currently do so in the CLI version. So skip setting these at
all, for now.

If a color is mentioned but empty, it will be set to empty.
2021-12-14 22:54:28 +01:00
Fabian Homborg
3daba1b070 webconfig: Stop translating named colors
If the theme says "brgreen", that's what we want the variable to say
after.

This used to translate it through our palette, so it ended up as
00ff00, which isn't the same.

This still keeps the idea that colors that aren't in the palette are
better, and it does it in a slightly roundabout way (translate color
string to rgb string, see if the rgb string is a key in that
translation dictionary), but it should work for now.
2021-12-14 22:51:54 +01:00
Aaron Gyes
4b018a7608 set completions: add more special variables, fix colors
* add --bold, --italics, all of them,
* and we add them as arguments so that they are do not
  render like long options, they are just self-descriptive
  literal strings in this context.
* solve an unneccessary global var.

Fixes #8518
2021-12-13 16:29:21 -08:00
Fabian Homborg
06fada7445 webconfig: Check variable name and value
Theoretically if this only includes simple characters, it won't cause
any issues. We already validate in other places but it doesn't hurt to
do this twice.
2021-12-13 21:59:08 +01:00
Fabian Homborg
c954d70e2f webconfig: Stop validating colors
Now that we have modifiers and can have backgrounds and such, simply
setting it as css style doesn't cut it.

So let's stop validating for now, the worst that can happen is that
the color isn't rendered.
2021-12-13 21:47:54 +01:00
Fabian Homborg
5a46a61ffb webconfig: Teach set_color short options
Since we now have .theme files we can't rely on it being normalized.
2021-12-13 21:47:54 +01:00
Fabian Homborg
ba0b7133ad webconfig: Allow transferring modifiers and backgrounds
This just simply passed the "color" value, which is just the
foreground color string.

Instead, we pass the actual object back, with the modifiers as bools
and foreground/background separate.

Our themes don't use background a lot, except in the pager, so this
never really came up.
2021-12-13 21:47:54 +01:00
Fabian Homborg
235581e8dc webconfig: Allow setting most pager colors
I'm not sure this ever worked before for most of these.

It currently still doesn't set the background, and the secondary
colors have a weird fallback.
2021-12-13 21:47:54 +01:00
Fabian Homborg
c75ecf9b03 webconfig: Allow setting a variable to empty 2021-12-13 21:47:54 +01:00
Johannes Altmanninger
b98f71c16f fish_config.rst: make the synopsis imply that "browse" is the default 2021-12-13 20:41:45 +01:00
Aaron Gyes
84f5e9db20
Update create_manpage_completions.py 2021-12-13 04:33:26 -08:00
Fabian Homborg
f082b6c1bd Only act on the locale vars we care about
Instead of 7a80ad74f, which adds ifdeffery, we simply drop the
variables we don't care about. This leaves two presumably
glibc-specific variables, but drops 5 variables like LC_MONETARY, so
it's overall a win.

This reverts commit 7a80ad74f4.
2021-12-13 11:52:17 +01:00
Emily Grace Seville
e25b719b26
__fish_tokenizer_state: replace "str" with "state" (#8550)
Bug introduced 4c1173f
2021-12-13 02:42:16 -08:00
Aaron Gyes
7a80ad74f4 Cordon off glibc locale vars just for glibc 2.2
Phew
2021-12-13 01:56:48 -08:00
Aaron Gyes
b05757ee56 Fit status feaetures in 80 columns 2021-12-13 01:24:47 -08:00
ridiculousfish
68ee2ff9f3 Bravely stop removing quotes in builtin history delete
The builtin history delete call has some code that removes a leading and
trailing quote from its arguments. This code dates back to ec34f2527a,
when the builtin was introduced.  It seems wrong and tests pass
without it. Let's bravely remove it.
2021-12-12 14:26:45 -08:00
Aaron Gyes
76eef0fea9 Fix some extra arguments for string format functions. 2021-12-12 14:06:17 -08:00
Aaron Gyes
04a4693b5b history.h:
some typedefs -> using declarations
make the documentation comments work
2021-12-12 13:36:14 -08:00
Aaron Gyes
549fae1400 ast.h: remove unused private member finished() 2021-12-12 13:05:48 -08:00
Aaron Gyes
cb10f34f2e web_config js: lots of undeclared local variables 2021-12-12 12:32:32 -08:00
Aaron Gyes
196b42e4eb pygments lexer: use the token type intended for CLI output
and squash an unused import
2021-12-12 12:00:23 -08:00
Aaron Gyes
57119fb84d conf.py: two unused imports, an unused local variable. 2021-12-12 10:45:50 -08:00
Aaron Gyes
ba7d51503e deroff.py: unneccessarry pass, unreachable code 2021-12-12 10:45:50 -08:00
Aaron Gyes
e98fff5883 completion generator: globals at module-level are redundant
also add shebang.
2021-12-12 10:45:50 -08:00
Aaron Gyes
8e61255a04 LGTM report: for has redundant else, output is always overwrtitten
introduced by 2aec6e5814
2021-12-12 10:45:50 -08:00
Aaron Gyes
ff1aea3d96 unnecessary pass statement 2021-12-12 10:45:50 -08:00
Johannes Altmanninger
8208fc4f87 Cleanup comment to match implementation
This was recently changed to return bool.
2021-12-12 18:21:35 +01:00
Johannes Altmanninger
fbb21a36f5 CHANGELOG: simplify example 2021-12-12 18:13:20 +01:00
Johannes Altmanninger
bb26e25b9d CHANGELOG: fix typo 2021-12-12 14:07:28 +01:00
Aaron Gyes
5e96f817a6
Update command.rst 2021-12-12 00:17:16 -08:00