aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* Merged in latest changes to docs and formatting tweaksGravatar Mark Griffiths2014-09-03
| | | | | | Addresses issue #1557 as well as fixing many typos, HTML errors and inconsistencies. Also introduces automatic syntax colouring and enables new documentation to be written in Markdown. TODO fix Tutorial.
* Simplify stylingGravatar Mark Griffiths2014-09-03
|
* Removed dupes from gitignoreGravatar Mark Griffiths2014-09-03
|
* Added some clutterGravatar Mark Griffiths2014-09-03
| | | | Subllime and a few temporary files.
* Documentation updateGravatar Mark Griffiths2014-09-03
| | | | | | Rework for Doxygen >1.8. Moved large parts of the documentation to a simplified format, making use of Markdown enhancements and fixing bad long options.
* Fix test output for `complete -e` testsGravatar Kevin Ballard2014-09-02
| | | | | GNU sort behaves stupidly when LC_ALL is not C. This caused the test output to be sorted wrong.
* Add tests for the various `complete -e` changesGravatar Kevin Ballard2014-09-02
|
* Erase all completions with `complete -c foo -e`Gravatar Kevin Ballard2014-09-02
| | | | | | | When passing `-e` to `complete -c foo` without any other options, all options for the command should be erased. Fixes #380.
* Don't erase old-style options with `complete -l foo -e`Gravatar Kevin Ballard2014-09-02
| | | | | When erasing long option completions, distinguish between gnu-style and old-style options, just like we do when adding and printing completions.
* Don't erase all long opts with `complete -e`Gravatar Kevin Ballard2014-09-02
| | | | | | When using `complete -c foo -l bar -e`, all long options for the command were being erased because it was also comparing the short option, which was 0.
* Don't segfault when erasing short option completionsGravatar Kevin Ballard2014-09-02
| | | | | | | When using `complete -s x -e`, the long option is unspecified, which makes it NULL. Comparing this to a `wcstring` segfaults. Fixes #1182.
* Fix F1 binding to work with multiple tokens.Gravatar Konrad Borowski2014-08-30
|
* Merge pull request #1655 from xakon/masterGravatar ridiculousfish2014-08-29
|\ | | | | Fix small typo in documentation
| * Fix small typo in documentationGravatar Christos Kontas2014-08-30
|/
* Fix fish_vi_mode.fishGravatar Nikolai Aleksandrovich Pavlov2014-08-29
|
* Trim trailing newline on cmdsubst when IFS=''Gravatar Kevin Ballard2014-08-29
| | | | | | | When $IFS is empty, command substitution no longer splits on newlines. However we still want to trim off a single trailing newline, as most commands will emit a trailing newline and it makes it harder to work with their output.
* Rework how screen size is trackedGravatar Kevin Ballard2014-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | The screen size is fetched after a SIGWINCH is delivered. The current implementation has two issues: * It calls ioctl() from the SIGWINCH signal handler, despite ioctl() not being a function that is known to be safe to call. * It's not thread-safe. Signals can be delivered on arbitrary threads, so we don't know if it's actually safe to be modifying the cached winsize in response to a signal. It's also plausible that the winsize may be requested from a background thread. To solve the first issue, we twiddle a volatile boolean flag in the signal handler and defer the ioctl() call until we actually request the screen size. To solve the second issue, we introduce a pthread rwlock around the cached winsize. A rwlock is used because it can be expected that there are likely to be far more window size reads than window size writes. If we were using C++11 we could probably get away with atomics, but since we don't have that (or boost), a rwlock should suffice. Fixes #1613.
* Fix `commandline` behavior in bind functionsGravatar Kevin Ballard2014-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a key is bound to a fish function, if that function invokes `commandline`, it gets a stale copy of the commandline. This is because any keys passed to `self-insert` (the default) don't actually get added to the commandline until a special character is processed, such as the R_NULL that gets returned after running a binding for a fish command. To fix this, don't allow fish commands to be run for bindings if we're processing more than one key. When a key wants to invoke a fish command, instead we push the invocation sequence back onto the input, followed by an R_NULL, and return. This causes the input loop to break out and update the commandline. When it starts up again, it will re-process the keys and invoke the fish command. This is primarily an issue with pasting text that includes bound keys in it. Typed text is slow enough that fish will update the commandline between each character. --- I don't know of any way to write a test for this, but the issue can be reproduced as follows: > bind _ 'commandline -i _' This binds _ to a command that inserts _. Typing the following works: > echo wat_is_it But if you copy that line and paste it instead of typing it, the end result looks like > _echo wat_isit With this fix in place, the pasted output correctly matches the typed output.
* Fix $SHLVLGravatar Kevin Ballard2014-08-29
| | | | | Due to being read-only, SHLVL wasn't being incremented properly for recursive invocations of fish.
* Add Fossil command completions.Gravatar Konrad Borowski2014-08-29
|
* Fix typo in German translationGravatar Philipp Klose2014-08-29
|
* Fix the assertion failure in expand_variables()Gravatar Kevin Ballard2014-08-28
| | | | | | | | | | | | | | | | | expand_variables() is slightly confused about how to handle last_idx. On input, it expects it to be the index to start processing at, but when called recursively it always passes the current index. This means that it may sometimes pass an index 1 past the end of the input string. Notably, that happens when typing something like > echo "$foo (where "foo" is any string that is not a prefix of some existing variable name) Fix this by explicitly defining last_idx as being the last processed index, meaning the next index to process is actually last_idx-1. This means we should call it with next.size() instead of next.size()-1.
* Make `commandline -P` actually workGravatar Kevin Ballard2014-08-24
| | | | | `commandline --paging-mode` worked but the short flags list accidentally omitted the documented `-P`.
* Clean up variable expansion, and properly handle embedded NULsGravatar ridiculousfish2014-08-24
|
* Don't suggest after | & or in commentsGravatar ridiculousfish2014-08-24
| | | | Fixes #1631
* Merge pull request #1630 from kballard/expand_variables_in_quoted_stringsGravatar ridiculousfish2014-08-23
|\ | | | | Fix various expansions issues with variables
* | Fix the compilation under gcc 4.9.0.Gravatar Konrad Borowski2014-08-22
| | | | | | | | | | | | | | | | gcc interpretes C99's compound literals more strictly by invalid the compound literal on implicit to pointer cast (because of automatic storage duration, 6.5.2.5.6 in C99 standard draft). This fixes the issue by not using compound literals at all.
* | Comment on why we run 'false' in web_config.pyGravatar ridiculousfish2014-08-22
| |
* | Show a non-zero status in the fish_config promptGravatar Kevin Ballard2014-08-22
| | | | | | | | | | When selecting a prompt with fish_config, render the prompt with a non-zero status so the user knows what it looks like.
* | Set up fish_{function,complete}_path properlyGravatar Kevin Ballard2014-08-22
| | | | | | | | | | | | | | In the base config.fish, fish_function_path and fish_complete_path have $__fish_datadir/{functions,completions} added to them if not already present. For some reason they were replacing the final path component instead of being added on to the end.
* | Add a test for syntax highlighting pipesGravatar ridiculousfish2014-08-22
| |
* | Highlight pipe characters correctlyGravatar Kevin Ballard2014-08-22
| | | | | | | | | | According to `fish_config`'s colors page, the pipe operator `|` is supposed to be colored the same as a statement terminator.
* | Make the `alias` built-in function work betterGravatar Kevin Ballard2014-08-22
| | | | | | | | | | | | | | | | The new --wraps functionality was breaking aliases of the form `alias foo='bar baz'`. That is, aliases where the body is multiple words. Extract the first word of the body and use that instead. Use better errors for aliases with no name or no body.
* | Merge branch 'master' of github.com:fish-shell/fish-shellGravatar ridiculousfish2014-08-22
|\ \
| * | webconfig: fixes for token securityGravatar Andy Lutomirski2014-08-22
| | | | | | | | | | | | | | | | | | * Use 16-byte tokens * Use os.urandom (random.getrandbits shouldn't be used for security) * Convert to hex correctly
| * | webconfig: Use a constant-time token comparisonGravatar Andy Lutomirski2014-08-22
| | | | | | | | | | | | This prevents a linear-time attack to recover the auth token.
* | | Merge branch 'make_type_better' of github.com:kballard/fish-shell into ↵Gravatar ridiculousfish2014-08-21
|\ \ \ | |/ / |/| | | | | kballard-make_type_better
* | | Clean up the IFS handling in command substitutionGravatar Kevin Ballard2014-08-21
| | | | | | | | | | | | | | | | | | Remove the useless ASCII test of the first byte of IFS. We don't split on the first character, we only use a non-empty IFS as a signal to split on newlines.
* | | doc: Document how IFS affects command substitutionGravatar Kevin Ballard2014-08-21
| | | | | | | | | | | | | | | | | | | | | IFS is used for more than just the read builtin. Setting it to the empty string also disables line-splitting in command substitution, and it's done this for the past 7 years. Some day we may have a better way to do this, but for now, document the current solution.
* | | doc: Fix docs on $HOME/$USERGravatar Kevin Ballard2014-08-21
| | | | | | | | | | | | | | | | | | The docs claimed that the $HOME and $USER variables could only be changed by the root user. This is untrue. They can be changed by non-root users as well.
* | | doc: Fix links in "Further help and development"Gravatar Kevin Ballard2014-08-21
| | | | | | | | | | | | | | | | | | Hyperlink the mailing list to the proper info page. Tweak the GitHub link to use https.
* | | set: Print an error when setting `umask` to a bad valueGravatar Kevin Ballard2014-08-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Repurpose the ENV_INVALID return value for env_set(), which wasn't currently used by anything. When a bad value is passed for the 'umask' key, return ENV_INVALID to signal this and print a good error message from the `set` builtin. This makes `set umask foo` properly produce an error.
| | * Fix error span for invalid slice indexesGravatar Kevin Ballard2014-08-21
| | | | | | | | | | | | | | | | | | | | | | | | The span now properly points at the token that was invalid, rather than the start of the slice. Also fix the span for `()[1]` and `()[d]`, which were previously reporting no source location at all.
| | * Color `"$foo[1"` as an errorGravatar Kevin Ballard2014-08-20
| | | | | | | | | | | | | | | | | | We can't color the whole argument as an error, since the tokenizer is responsible for that and doesn't care abou this case, but we can color the `$foo[` bit as an error.
| | * Fix highlighting of `"foo\"bar"`Gravatar Kevin Ballard2014-08-20
| | | | | | | | | | | | | | | | | | | | | The backslash-escape wasn't being properly caught by the highlighter. Also remove the highlighting of `"\'"`, as `\'` is not a valid escape in double-quotes, and add highlighting for a backslash-escaped newline.
| | * Highlight "$foo[1]" properlyGravatar Kevin Ballard2014-08-20
| | | | | | | | | | | | | | | Preserve the highlighting applied to the slice brackets when coloring variables inside of double-quoted strings.
| | * Parse slices even for empty variablesGravatar Kevin Ballard2014-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a variable is parsed as being empty, parse out the slice and validate the indexes anyway, behaving for slicing purposes as if the variable had a single empty value. Besides providing errors when expected, this also fixes the following: set -l foo echo "$foo[1]" This used to print "[1]", now it properly prints nothing.
| | * Fix double expansions (`$$foo`)Gravatar Kevin Ballard2014-08-20
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Double expansions of variables had the following issues: * `"$$foo"` threw an error no matter what the value of `$foo` was. * `set -l foo ''; echo $$foo` threw an error because of the expansion of `$foo` to `''`. With this change, double expansion always works properly. When double-expanding a multi-valued variable, in a double-quoted string the first word of the inner expansion is used for the outer expansion, and outside of a quoted string every word is used for the double-expansion in each of the arguments. > set -l foo bar baz > set -l bar one two > set -l baz three four > echo "$$foo" one two baz > echo $$foo one two three four
* | Make escape_string transform wildcard charactersGravatar ridiculousfish2014-08-16
| | | | | | | | | | | | The characters ANY_CHAR, ANY_STRING, and ANY_STRING_RECURSIVE are currently transformed by unescape, but not by escape. Let's try escaping them. Fixes #1614.
* | Support for command wrapping ("aliases")Gravatar ridiculousfish2014-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the --wraps option to 'complete' and 'function'. This allows a command to (recursively) inherit the completions of a wrapped command. Fixes #393. When evaluating a completion, we inspect the entire "wrap chain" for a command, i.e. we follow the sequence of wrapping until we either hit a loop (which we silently ignore) or the end of the chain. We then evaluate completions as if the wrapping command were substituted with the wrapped command. Currently this only works for commands, i.e. 'complete --command gco --wraps git\ checkout' won't work (that would seem to encroaching on abbreviations anyways). It might be useful to show an error message for that case. The commandline builtin reflects the commandline with the wrapped command substituted in, so e.g. git completions (which inspect the command line) will just work. This sort of command line munging is also performed by 'complete -C' so it's not totally without precedent. 'alias will also now mark its generated function as wrapping the 'target.