Commit graph

6932 commits

Author SHA1 Message Date
ridiculousfish
dec0f7aa84 Make s_generation_count a std::atomic
This should improve safety and satisfy tsan
2017-03-26 13:44:27 -07:00
ridiculousfish
44b3554a11 Reorder a lock to prevent a potential deadlock in uvars
A call to default_vars_path() takes the environment variable
lock while the uvars lock is held. Ensure that doesn't happen by
deferring the uvars lock to later in the function.
2017-03-26 13:22:23 -07:00
ridiculousfish
9f13edbe4a Fix a buffer overflow in cached_esc_sequences_t::find_entry
cached_esc_sequences_t::find_entry was constructing a wcstring
from a c string, using lengths longer than the length of the cstring.

Detected with asan.
2017-03-26 12:55:15 -07:00
Fabian Homborg
3d6c4adda9 Fix unescaped ' literals in bracketed-paste
This was a case of a missing \\.

Fixes #3913.
2017-03-26 09:33:11 +02:00
Kurtis Rader
38c851f4cf let read take a simple string for the prompt
Fixes #802
2017-03-25 20:24:43 -07:00
Fabian Homborg
e1c3ec25ab Document snippet sourcing order
Fixes #3099.
2017-03-23 17:46:11 +01:00
Kurtis Rader
542962bc69 document events are per fish process
Fixes #2954
2017-03-22 20:53:39 -07:00
Kurtis Rader
ae0321778f empty CDPATH elements are equivalent to "."
In the process of fixing the issue I decided it didn't make sense to
have two, incompatible, ways of converting variable strings to arrays.
Especially since the one I'm removing does not return empty array elements.

Fixes #2106
2017-03-22 19:30:42 -07:00
Fabian Homborg
570a6430ad Update changelog
- Mention setenv

- Don't mention bracketed paste twice, group paste-related changes together
2017-03-22 14:41:09 +01:00
Fabian Homborg
83791a26c3 Stringify mkinitcpio completions
Also fixes an issue with the -k completions.
2017-03-21 01:31:26 +01:00
Fabian Homborg
2118973251 Document \cn/\cp bindings
We want to downplay this in favor of the arrow keys, but mentioning it
is still the right thing to do.

Supersedes #3879.
2017-03-20 16:49:29 +01:00
Fabian Homborg
70354f9f5e Add bind --list-modes option
Fixes #3872.
2017-03-20 16:42:53 +01:00
Kurtis Rader
536b1220fd cleanup __fish_complete_man.fish
I looked at this and noted some problems fixed by this change in
response to exploring if issue #726 was still unresolved.
2017-03-18 21:55:02 -07:00
Fabian Homborg
b6517250c7 vi-mode: \cd should do delete-or-exit
This just removes the special vi binding and hence falls back upon the
shared one.

Fixes #2219.
2017-03-17 12:07:10 +01:00
Kurtis Rader
a811ae25dc don't preemptively send SIGPIPE
Fixes #1926
2017-03-16 18:59:34 -07:00
Fabian Homborg
29429874b3 Update changelog with the paste changes 2017-03-16 16:13:19 +01:00
Fabian Homborg
99e87dded3 Auto-escape pastes inside single-quotes
This is to make pasting literals easier.

When a user pastes something, we normally take it as-is.

The exception is when a single-quote is open, e.g. the current token
is

    foo'bar

When something is pasted here, we escape single-quotes (`'`) and
backslashes (`\\`), so typing a `'` after it will turn it into a
literal token.

Fixes #967.
2017-03-16 16:08:13 +01:00
Kurtis Rader
84cf391faa style cleanups 2017-03-15 14:06:58 -07:00
Kurtis Rader
f0469d829a string repeat of an empty string is an error
Fixes #3898
2017-03-15 13:55:53 -07:00
Kurtis Rader
6fd8dc44fb support test -k to test the sticky bit
Fixes #733
2017-03-14 21:43:15 -07:00
Kurtis Rader
6123d3cb50 document trap ... EXIT
Fixes #1180
2017-03-14 21:02:02 -07:00
Kurtis Rader
516e989464 mention string repeat in the change log 2017-03-14 19:44:07 -07:00
Kurtis Rader
085a9b9267 fix stupid typo introduced by d9b30ab09 2017-03-14 13:17:53 -07:00
Kurtis Rader
d9b30ab090 setenv should behave like export
Fixes #3897
2017-03-14 12:14:22 -07:00
Kurtis Rader
7ab1c6c7ad update CHANGES.md 2017-03-13 21:44:05 -07:00
Kurtis Rader
1afea1b650 add description to functions -m -v output
Fixes #597
2017-03-13 20:52:31 -07:00
Kurtis Rader
8efe88201e correct escape_string corner case
Fixes #3892
2017-03-13 20:38:57 -07:00
mus0u
b4f70cb98b include exit status indicator in robbyrussell sample prompt 2017-03-13 18:05:49 -07:00
Greynad
98f4e49669 Add string 'repeat' subcommand
This feature add the ability to repeat a string a given number of times.
For example: string repeat -n 3 foo
2017-03-12 20:30:36 -07:00
Kurtis Rader
e0f62c178f make not blocking signals the default
This is the next step in determining whether we can disable blocking
signals without a good reason to do so. This makes not blocking signals
the default behavior. If someone finds a problem they can add this to
their ~/config/fish/config.fish file:

set FISH_NO_SIGNAL_BLOCK 0

Alternatively set that env var before starting fish. I won't be surprised
if people report problems. Till now we have relied on people opting in
to this behavior to tell us whether it causes problems. This makes the
experimental behavior the default that has to be opted out of. This will
give us a lot more confidence this change doesn't cause problems before
the next minor release.

Note that there are still a few places where we force blocking of
signals. Primarily to keep SIGTSTP from interfering with the shell in
response to manipulating the controlling tty. Bash is more selective
in the signals it blocks around the problematic syscalls (c.f., its
`git_terminal_to()` function). However, I don't see any value in that
refinement.
2017-03-10 21:34:24 -08:00
Kurtis Rader
6d02bec4c7 fix setting up and using the terminfo data
There should be just one place that calls `setupterm()`. While refactoring
the code I also decided to not make initializing the curses subsystem a
fatal error. We now try two fallback terminal names ("ansi" and "dumb")
and if those can't be used we still end up with a usable shell.

Fixes #3850
2017-03-08 20:54:37 -08:00
David Adam
42a320064c fallback: restore wcsndup fallback for Apple platforms
Problem introduced in commit 002757225a.
2017-03-06 21:39:37 +08:00
David Adam
002757225a fallback: check for existence of std:: namespace functions
Before defining fallback functions of wcsdup(), wcscasecmp() and
wcsncasecmp(), use the std:: namespace functions instead if they exist.

0019c12af3 fixed the build on Solaris 10, but broke it on Solaris 11.
2017-03-06 21:24:40 +08:00
Fabian Homborg
db63be7909 Add support for bracketed paste
This is a terminal feature where pastes will be "bracketed" in
\e\[200~ and \e\[201~.

It is more of a "security" measure (since particularly copying from a
browser can copy text different from what the user sees, which might
be malicious) than a performance optimization.

Work towards #967.
2017-03-06 00:19:46 +01:00
David Adam
3444fe87fb configure: check for definition of setupterm, not just linkability
Some platforms ship the headers and libraries for ncurses in different
packages, which can produce false positives when checking for their
presence.

Closes #3866.
2017-03-05 15:06:20 +08:00
Kurtis Rader
fac9b2393f change the github issue template
I have noticed that too many new issues have not used the issue template
in the expected manner. Primarily because most people opening issues are
not accustomed to Github Markdown syntax. So change the template to be
exclusively a comment that provides advice regarding what information
will help the fish community resolve a issue.
2017-02-28 21:29:50 -08:00
Dan Zimmerman
f17ddb6770 Fix error when using tmux with vi mode 2017-02-28 19:05:05 +01:00
Kurtis Rader
ea9e05568e Revert "make not blocking signals the default"
This reverts commit e30f3fee88.

Not sure why I didn't notice this before merging it but the change I'm
reverting makes it impossible to start a login shell.
2017-02-25 21:06:30 -08:00
Kurtis Rader
e30f3fee88 make not blocking signals the default
This is the next step in determining whether we can disable blocking
signals without a good reason to do so. This makes not blocking signals
the default behavior. If someone finds a problem they can add this to
their ~/config/fish/config.fish file:

set FISH_NO_SIGNAL_BLOCK 0

Alternatively set that env var before starting fish. I won't be surprised
if people report problems. Till now we have relied on people opting in
to this behavior to tell us whether it causes problems. This makes the
experimental behavior the default that has to be opted out of. This will
give is a lot more confidence this change doesn't cause major problems
prior to the next minor release.
2017-02-22 21:53:49 -08:00
Kurtis Rader
7d65141137 be quiet when make style does nothing
The `make style` and `make style-all` commands have been performing well
without glitches for long enough that it is no longer necessary to report
when they don't change the style of a file. Especially in light of the
fact that all the relevant code has been restyled in the past year. This
change makes `make style-all` much less noisy.
2017-02-22 20:57:15 -08:00
Clément Martinez
64fe617c63 Add gradle completions 2017-02-22 20:01:13 -08:00
Georgy Yakovlev
b2174bc9c0 support the LINGUAS variable by make install
Fixes 3863
2017-02-22 19:58:06 -08:00
Kurtis Rader
7a9efa7930 tweak gitignore rules for *tests* directory 2017-02-20 20:29:43 -08:00
Kurtis Rader
9dd0c47d0b harden alias against foo; bar
If the first word of the alias body ends with a semicolon we need to
strip that character, and otherwise escape the extracted command, to
ensure the subsequent function definition is valid.

Fixes #3860
2017-02-20 20:23:55 -08:00
Kurtis Rader
992e1d0059 use a consistent ERANGE message
The previous change neglected to consider that numbers too large for the
long long datatype will result in calling strerror(ERANGE) whose return
value can vary depending on the platform. Which breaks the unit test.
2017-02-20 18:43:13 -08:00
Kurtis Rader
3d0a377e26 correct printf handling of %x with long ints
Fixes #3352
2017-02-20 17:58:08 -08:00
Kurtis Rader
9f5ce04229 fix perl completions
Fixes #3856
2017-02-18 19:54:36 -08:00
Twinkle
a9617f97b6 enhance git repo for Robbyrussell prompt 2017-02-18 17:11:38 -08:00
Fabian Homborg
0a8c922d92 Use command -sq instead of redirection
This option has been available for a while now and it's a bit shorter.
2017-02-18 22:16:55 +01:00
David Adam
40de253b3a Upgrade git:// and http:// URLs to https://
Work on fish-shell/fish-site#47

[ci skip]
2017-02-17 21:31:44 +08:00