Commit Graph

4417 Commits

Author SHA1 Message Date
ridiculousfish
c31ad3ed07 Disallow backgrounding in conditionals and before and/or bool statements
Fixes #1136
2014-11-02 13:11:27 -08:00
ridiculousfish
c33a3862cc Disable printf %a test since it has different output on FreeBSD
Fixes #1139
2014-11-02 00:27:52 -07:00
ridiculousfish
6cc64fc9e3 BOM test should only run in UTF-8 locales 2014-11-02 00:14:16 -07:00
ridiculousfish
aafff91ac8 Fix tests on FreeBSD
FreeBSD throws errors if you pass flags like O_WRONLY to mkostemp.
Pass only O_CLOEXEC.
2014-11-01 23:57:12 -07:00
ridiculousfish
4b6639f697 Allow # within string tokens
This means that # must be the first character of the string
to start a comment, in line with other shells

Fixes #953
2014-11-01 21:06:16 -07:00
ridiculousfish
fa588db148 Fix to swallow BOMs in sourced files
Fixes #1518
2014-11-01 16:25:28 -07:00
ridiculousfish
851f0bcfb3 Remove some more dead code 2014-11-01 13:57:21 -07:00
Jared Grubb
d9d9fa512d vi bindings: add CTRL-C handler in default mode
There is no CTRL-C handler for the default mode in the vi bindings. This makes it difficult to say "never mind" and start a new command line like you can do in bash's vi mode. 

There were CTRL-C handlers for insert and visual modes that go back to default mode, but nothing happens in default mode. I copy-pasted the CTRL-C handler from the default key bindings file.
2014-10-31 22:17:17 -07:00
ridiculousfish
84372ba79d Don't suggest non-directories when tab completing cd
Fixes #1059
2014-10-31 10:44:32 -07:00
ridiculousfish
7ac593273e Remove a bunch of dead code identified by cppcheck 2014-10-31 01:15:50 -07:00
ridiculousfish
a529fc9d83 Set of fixes for issues identified by cppcheck 2014-10-30 22:40:35 -07:00
ridiculousfish
173a6a71c0 Fix C_ call to work when gettext is present 2014-10-30 21:59:23 -07:00
ridiculousfish
a177eb8c16 Fix expansion tests on OS X 2014-10-30 21:51:23 -07:00
ridiculousfish
16459099af Make C_ (gettext used in completions) return wcstring 2014-10-30 18:52:37 -07:00
ridiculousfish
fa854d7a01 Eliminate wcsv2strv 2014-10-30 18:52:37 -07:00
ridiculousfish
b3b83449cf Clean up some memory allocation in builtin_commandline 2014-10-30 18:52:37 -07:00
Alex Sulim
d62694a9ce Update completion for Bundler
All commands and options available for Bundler version 1.7.4

Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au> (with trailing
fullstops removed)
2014-10-28 11:58:31 +08:00
Kevin Ballard
6044ac7e5e Fix 3rd arg to PROCESS_EXIT event for %self
The PROCESS_EXIT event takes 3 args: event name, pid, status. However,
when fish is exiting, the PROCESS_EXIT is instead given the status of
whether the last commandline parsed successfully. Change it to use the
same value that fish itself is going to exit with.
2014-10-27 17:23:08 -07:00
Kevin Ballard
ec5f3d0cc8 Don't require .git before running git-describe
When calculating the version, we don't need to test for the presence of
.git before running `git describe`. This lets us work properly in a
detached work tree if GIT_DIR is set.
2014-10-27 15:46:22 -07:00
Natrim
f03d90e9de Add Composer completion 2014-10-26 22:04:47 +08:00
David Adam
a31b44f9b2 contains: add documentation regarding the use of --
Closes #1194.

[skip ci]
2014-10-26 19:02:03 +08:00
David Adam
a580d04dbc history: put the output through the pager in interactive mode
(Ideally, the behaviour of git could be implemented: pipe the input
through a pager iff the length is > window size and in interactive
mode).

Closes #1076.
2014-10-26 17:19:29 +08:00
Pawel Zubrycki
c84cdcd00c Added hg repo status to robbyrussell example prompt 2014-10-26 16:00:12 +08:00
David Adam
5638764bad prompt_pwd: Use tilde expansion to get real full home path
Closes #1133.
2014-10-26 14:20:49 +08:00
David Adam
ab7af98ded expand: expand tilde to canonical paths
Work on #1133.
2014-10-26 08:50:28 +08:00
ridiculousfish
b0e09303a6 Reintroduce "Stop reaping children from SIGCHLD handler"
This re-introduces 3fe1069219
with some associated fixes to address #1768.
2014-10-25 16:51:25 -07:00
David Adam
a242a64833 Move LICENSE to COPYING and update text.
Work on #1073.

fish is not exclusively distributed under the GPL version 2; the
canonical reference is doc_src/license.hdr, so use that as the full
description.

[skip ci]
2014-10-24 17:40:35 +08:00
ridiculousfish
315ff1e712 Revert "Stop reaping children from SIGCHLD signal handler"
This reverts commit 3fe1069219.

In light of #1768
2014-10-21 11:33:22 -07:00
ridiculousfish
21a751d153 Revert "Remove some previously buggy but dead code that I mistakenly resurrected"
This reverts commit 090f027de1.
2014-10-21 11:33:12 -07:00
ridiculousfish
090f027de1 Remove some previously buggy but dead code that I mistakenly resurrected 2014-10-20 21:47:29 -07:00
Roman Inflianskas
cfa41686d2 Add setfacl completions 2014-10-21 08:27:32 +08:00
ridiculousfish
3fe1069219 Stop reaping children from SIGCHLD signal handler
Prior to this fix, a child process may be reaped in one of two ways:
1. By a call to waitpid() within job_continue
2. By a call to waitpid() within the SIGCHLD signal handler

Only the second call was with the WNOHANG option. Thus if the signal
handler fired first, and then the waitpid call fired, we could get a
deadlock because we'd end up waiting on a long-running process. I have
not been able to reproduce this on fish 1.x, though it seems like it
ought to reproduce there too.

This fix migrates the waitpid() call out of the signal handler; the
second class of calls moves to job_reap. This eliminates the possibility
of a race, because we check for job completion before calling waitpid,
and there is no longer the possibility of the job being marked as
complete asynchronously. It also results in a massive conceptual
simplification, since the signal handler is now very simple and easy to
reason about (no more walking jobs lists, etc).

This partially fixes a bug reported in #1273
2014-10-20 15:50:54 -07:00
ridiculousfish
98091faeaf Add an assertion to reflect unreachable code 2014-10-19 18:00:49 -07:00
ridiculousfish
15e095233b Allow funced to retry on error
Fixes #1371
2014-10-17 11:50:09 -07:00
David Adam
a64c372a28 web_config: add support for adding and editing abbreviations
Possible future enhancements include explanatory text and an image for
the 'save' action.

Work on #731.
2014-10-17 10:28:26 +08:00
David Adam
1f91a2a6f5 web_config: map nonexistent post requests to 404 2014-10-17 10:28:26 +08:00
David Adam
4aa38db56f ls: find and use various dircolors initialisation files, if they exist
Closes #1758.
2014-10-17 10:23:05 +08:00
ridiculousfish
9e32b330aa Unescape strings in keyword detection.
This allows keywords to be quoted. However, they may not contain
variable or process expansions, etc. Fixes #1398
2014-10-15 12:49:02 -07:00
ridiculousfish
049bd227ed Remove EXPAND_SKIP_PROCESS, which did not actually work 2014-10-15 12:43:06 -07:00
ridiculousfish
ff7108877b Use binary search to determine what tokens are keywords 2014-10-15 12:04:23 -07:00
ridiculousfish
1927ebbc5d Improve error reporting for unclosed blocks 2014-10-14 00:41:39 -07:00
Kevin Ballard
5db9548f40 Run make depend 2014-10-13 19:29:07 -07:00
Kevin Ballard
cab115c8b9 Don't stop job execution on wildcard errors
Wildcard errors are only reported interactively, and they're also not
really errors. Commands with multiple wildcards would in fact continue
executing if at least one wildcard matched, which is quite surprising.
But they would report an error if there is only one wildcard in the
arguments list and the wildcard has no match, even if there are other
remaining arguments.

Given this inconsistency, and given that sh does not stop execution if a
wildcard fails to match, it seems better to allow execution to continue.
This is better from a scripting perspective anyway, as it means
constructs like `set -l paths foo/*.txt` will actually create the
variable (with an empty value) instead of skipping the `set`
altogether and perhaps causing subsequent code to read or modify a
global or universal variable.
2014-10-13 18:51:51 -07:00
Kevin Ballard
4568359e27 Remove some obsolete job flags
These flags were used by the old parser, but not by the new one.
2014-10-13 18:33:55 -07:00
Kevin Ballard
07e4170418 Suppress wildcard errors in functions
Wildcard errors are only supposed to reported when encountered during
interactive use. The old parser also suppressed them if `is_block` was
true. This was lost in the new parser. However, this also suppresses
errors generated from `begin; code_here; end` and other block
constructs.

Instead, check the parser block stack when we hit an error, and suppress
the error if there are any function calls / events / source invocations.
These all indicate that the code being executed came from somewhere
other than the commandline.
2014-10-13 17:49:26 -07:00
Kevin Ballard
0372cdbe7e Standardize unmatched wildcard errors
Unmatched wildcard errors during parsing are normally only reported when
run interactively. The switch command was unconditionally reporting them
anyway (and not setting the status to 124). Fix it so switch goes
through the same code path as everything else.
2014-10-13 17:27:56 -07:00
ridiculousfish
5d1ddc9c58 Report certain errors from parser_t::eval() that were previously ignored 2014-10-12 20:09:45 -07:00
ridiculousfish
c0b8e81b02 Change how arrays and environment variables interact.
Prior to this change, inherited environment variables
would be split on colons, becoming an array. This change
eliminates that behavior. Now environment variables are
always split on the record separator character (ASCII 0x1e),
with the exception of a short whitelist of PATH, MANPATH,
CDPATH. Likewise, exported variables are also exported
delimited by rs, with the exception of the above whitelist.

Fixes #1374, also see #1656
2014-10-12 15:01:44 -07:00
Konrad Borowski
c3bacc78c7 Mark unknown versions as unknown. 2014-10-12 15:01:48 +02:00
David Adam
4140e678f4 web_config: further python2/3 unification 2014-10-12 16:04:40 +08:00