Commit graph

14374 commits

Author SHA1 Message Date
Johannes Altmanninger
72fd328ad2 fish_clipboard_{copy,paste}: only use xsel/xclip if $DISPLAY is set
Ubuntu's fish package on WSL 1 has xsel as recommended dependency,
even though there is no X server available.  This change makes us
use Windows' native clipboard even when xsel is installed.
2021-07-23 20:55:07 +02:00
ridiculousfish
938879a85a Remove a stale comment and add a missing initializer 2021-07-23 11:22:45 -07:00
ridiculousfish
5f7e03ccf4 Introduce noncopyable_t and nonmovable_t
These are little helper types that allow us to get rid of lots of
'=delete' declarations.
2021-07-23 11:19:42 -07:00
ridiculousfish
e9ff3f2e65 Remove a stale comment. 2021-07-23 11:19:42 -07:00
Fabian Homborg
7167ba6e08 Work around Terminal.app's awkward alt-left/right sequences
Just do the more involved thing.

Blergh.

Fixes #2330.
2021-07-23 19:38:43 +02:00
Fabian Homborg
3cc59a9a12 docs: Document how complete groups options
Fixes #8146.
2021-07-23 19:29:16 +02:00
Fabian Homborg
7a5587de75 docs: Reword cd a bit 2021-07-23 18:00:57 +02:00
Fabian Homborg
152097ca34 doc: Some more rewordings
I'm struggling to avoid this massive list of files and directories.

Maybe a second section for integrators?
2021-07-23 18:00:57 +02:00
Aniruddh Agarwal
0445126c2e Undunder __fish_is_nth_token
We keep __fish_is_nth_token for compatibility and edit the
implementations of __fish_is_nth_token, __fish_is_first_token and
__fish_is_token_n to use fish_is_nth_token
2021-07-23 17:25:50 +02:00
Fabian Homborg
859edc9c2c Implicitly use $PWD in $CDPATH in completions and highlighting
We already do for the actual cd-ing itself.

Missed in #4484.

Fixes #8161.
2021-07-23 17:22:06 +02:00
Fabian Homborg
c35ffc58fc
Merge pull request #8134 from thunder-coding/complete-more-git-commands
Add missing completions for some git commands
2021-07-23 08:01:38 +02:00
Yaksh Bariya
e9a16ed7b5
Fix typos 2021-07-23 06:55:07 +05:30
Yaksh Bariya
692c6ae118 Add completions for git-sizer 2021-07-22 19:29:05 +02:00
Fabian Homborg
11da6db009 Cleanup of a comment 2021-07-22 19:19:49 +02:00
Yaksh Bariya
29fc74bc6a
Remove -F supplied to complete
Using `complete -F -c git -n __fish_git_needs_subcommand -a $command -d
$description` causes file completions to be forced on entire git command
which is not a desired result. Morever without the `-F` flag file
completions work just as expected and is useless addition
2021-07-22 17:06:59 +05:30
Yaksh Bariya
6f52c017ba
Resolve all conversations 2021-07-22 13:26:38 +05:30
Yaksh Bariya
54476d583b
Add flag completions for git mv 2021-07-22 13:25:12 +05:30
Yaksh Bariya
9d0d0b81fd
Add completions for git apply 2021-07-22 13:25:12 +05:30
Yaksh Bariya
162c4ac789
Add completions for git mailsplit 2021-07-22 13:25:12 +05:30
Yaksh Bariya
4c5f41531d
Add completions for git am 2021-07-22 13:25:12 +05:30
Yaksh Bariya
2e34852ded
Add completions for git mailinfo 2021-07-22 13:25:12 +05:30
Yaksh Bariya
3f5f722e7a
Add completions for git stripspace 2021-07-22 13:25:11 +05:30
Yaksh Bariya
f976144b27
Add completions for git notes 2021-07-22 13:25:11 +05:30
Yaksh Bariya
1344b638d2
Add completions for git maintenance 2021-07-22 13:25:11 +05:30
Yaksh Bariya
55886943c1
Add missing completions for git daemon 2021-07-22 13:25:06 +05:30
ridiculousfish
ce371e1881 Put back support for undocumented -I option to commandline
This allows operating on a user-specified commandline instead of the
true contents. This was inadvertently removed in a32248277f.
2021-07-21 15:35:22 -07:00
Fabian Homborg
0f127cc7f3 Ye olde logge of changes 2021-07-21 22:34:52 +02:00
Fabian Homborg
3359e5d2e9
Let "return" exit a script (#8148)
Currently, if a "return" is given outside of a function, we'd just
throw an error.

That always struck me as a bit weird, given that scripts can also
return a value.

So simply let "return" outside also exit the script, kinda like "exit"
does.

However, unlike "exit" it doesn't quit an interactive shell - it seems
weird to have "return" do that as well. It sets $status, so it can be
used to quickly set that, in case you want to test something.
2021-07-21 22:33:39 +02:00
ridiculousfish
a32248277f Make commandline state thread safe
Today the reader exposes its internals directly, e.g. to the commandline
builtin. This is of course not thread safe. For example in concurrent
execution, running `commandline` twice in separate threads would cause a
race and likely a crash.

Fix this by factoring all the commandline state into a new type
'commandline_state_t'. Make it a singleton (there is only one command
line
after all) and protect it with a lock.

No user visible change here.
2021-07-21 11:51:46 -07:00
ridiculousfish
49c8ed9765 Migrate the fix for 6892 into reader itself
No functional change here; this migrates the fix ensuring that history
items are available in the builtin interactive read command into the
reader itself, in preparation for removing reader_get_history().
2021-07-21 11:51:46 -07:00
Kevin F. Konrad
869c42d72a
Add completion for azure cli (az) (#8141)
* add completion for azure cli (az)

* alter az.fish to match faho's requests

Co-authored-by: Kevin Konrad <kevin.konrad@unicepta.com>
2021-07-21 17:57:59 +02:00
Fabian Homborg
58997cae2f CHANGELOG Some rewording and reordering
$() is definitely Notable.
2021-07-20 21:04:43 +02:00
Fabian Homborg
4be6021131 docs: Some de-alienizing of the configuration section
Still not happy with this, it's overwhelming!

Might have to split this into two - one with simple paths and rough
descriptions, and one with the full scoop for experts?
2021-07-20 21:03:55 +02:00
Evan Miller
c4773d4052 Work around setpgid error on older Apple platforms
Expand the #7474 fix to Apple platforms. The issue affects older
OS versions, including Mac OS X 10.4.11.
2021-07-20 17:27:10 +02:00
Fabian Homborg
07457bf2f1 cmake: Remove linker override
This was a workaround for an error that has been removed in glibc
2.32 (by removing sys_errlist and friends, which it complained about).

Other than that, it's an attempt at performance optimization that
should just be fixed at the system level - if your linker is bad,
replace it with a better linker. No need for fish to work around it.

Closes #8152
2021-07-20 17:20:14 +02:00
Jan Palus
0918653510 Handle absolute path in CMAKE_INSTALL_DATADIR
Cmake accepts both absolute and relative paths in CMAKE_INSTALL_DATADIR.
For the latter case CMAKE_INSTALL_PREFIX is being prepended
automatically. %{rel_datadir} is derived from CMAKE_INSTALL_DATADIR
which was assumed to be relative and otherwise causes issues in a .pc
file where prefix is being prepended unconditionally.

Make sure %{rel_datadir} is relative by calculating RELATIVE_PATH from
CMAKE_INSTALL_PREFIX to CMAKE_INSTALL_FULL_DATADIR which is known to be
absolute.

Fixes #8150
2021-07-20 13:43:34 +02:00
ridiculousfish
b0dc72ee78 Minor clean up of set_buffer_maintaining_pager 2021-07-18 13:18:55 -07:00
Johannes Altmanninger
52f7e83113 Complete revert of faulty polling workaround
62d8f7277 ("Revert "Avoid excessive polling of universal variable
file"") was not a complete revert, which seems to have caused the
problem reported in https://github.com/IlanCosman/tide/issues/171.

See #8088
2021-07-18 18:41:04 +02:00
ridiculousfish
8abc8315de Remove some more ASSERT_IS_MAIN_THREADs
These aren't helping and are blocking testing of concurrent execution.
No functional change here.
2021-07-17 12:20:54 -07:00
Fabian Homborg
e9a793532e Stop cd "" from crashing
Fixes #8147.
2021-07-17 19:03:15 +02:00
Fabian Homborg
b0981ef6db Should auld changelogges be forgotten? 2021-07-16 20:29:09 +02:00
Fabian Homborg
f3f6e4a982 string: Add "--groups-only" to match
This adds a simple way of picking bits from a string that might be a
bit nicer than having to resort to a full `replace`.

Fixes #6056
2021-07-16 20:27:54 +02:00
Fabian Homborg
801d7e3e11 docs: Document that the man pages are for our builtins
For builtins that have the same name as common commands, it might not
be entirely obvious that there is another page.

So, for those builtins, we add a note, but only in the man pages.

(exception is true and false because the note would be longer than the
page, and it's fridging true and false)

Fixes #8077.
2021-07-16 18:21:41 +02:00
Fabian Homborg
ee8c5579f3 docs: Add some links
(and remove a stray sentence)
2021-07-16 18:08:55 +02:00
Fabian Homborg
a6699576ce docs: Some more $() changes 2021-07-16 18:08:36 +02:00
Fabian Homborg
405a03bfae fish_config: Pass filenames as arguments
This injected filenames into fish script, which could inject things
that looked like fish script.

E.g. create a file called `~/.config/fish/themes/"; rm -rf ~/*"`.

Note that the prompts are all shipped by us, but the themes can
technically be added by the user, and they might not be dilligent in
what filenames they allow.
2021-07-16 17:30:35 +02:00
ridiculousfish
f345464879 Simplify ASSERT_SORT_ORDER
In practice this only looked at the name property, so we can simplify it
by using an ordinary template function instead of a macro.
2021-07-15 13:15:24 -07:00
ridiculousfish
a638c4f01d const_strlen to be aware of interior nul chars
Prior to this change, const_strlen would only look for trailing nul
chars. Teach it about interior nul chars and add some tests.
2021-07-15 13:07:09 -07:00
ridiculousfish
ccd1b4e4f4 Clean up of get_function_name
Have it return a real string, instead of a pointer with uncertain
lifetime.
2021-07-15 11:36:43 -07:00
ridiculousfish
bad1b84513 Remove the index parameter from parser_t::is_function
It was always 0 in practice.
2021-07-15 11:04:06 -07:00