Commit Graph

5475 Commits

Author SHA1 Message Date
Aaron Gyes
ecf4517ffe Fix crash with empty $TERM
```
~ $ set -e TERM; fish
Assertion failed: (!is_missing), function c_str, file src/env.cpp, line 690.
fish: 'fish' terminated by signal SIGABRT (Abort)
```
2016-06-21 16:21:15 -07:00
Kurtis Rader
eb834f47ef put curses/terminfo vars into the environment
We need to actually export the curses/terminfo env vars in order for
`setupterm()` to be able to use them. While fixing this I reworked the
fallback logic implemented by @zanchey in response to issue #1060 in
order to simplify the logic and clarify the error messages.

This does not allow someone to change the curses/terminfo env vars after
the first prompt is displayed (you can but it won't affect the current
fish process). It only makes it possible to set `TERM`, `TERMINFO`, and
`TERMINFO_DIRS` in *config.fish* or similar config file and have them be
honored by fish.
2016-06-21 16:18:45 -07:00
Fabian Homborg
e0a627f99d Revert "Document clipboard bindings."
This was added by accident - the actual clipboard change is not included in 2.3.1, so this has no place there.

This reverts commit 00291c1c5a.
2016-06-21 17:45:38 +02:00
Fabian Homborg
8070cd81d6 npm completions: Check command npm existence
Really fixes #3158 and #3152.

(cherry picked from commit 10661bb024)
2016-06-21 17:43:55 +02:00
Fabian Homborg
00291c1c5a Document clipboard bindings.
(cherry picked from commit f9edcbbbe2)
2016-06-21 17:43:55 +02:00
Fabian Homborg
bc8ec46ef9 npm completions: Call command npm
npm is often wrapped by a function.

Fixes #3158.

(cherry picked from commit 3a0d417b9e)
2016-06-21 12:40:23 +02:00
Fabian Homborg
7e56d6385e History docs: Move descriptions to the corresponding options
This should clarify `--delete`s behavior without `--prefix` or
`--contains` a bit.

Fixes #3054.
2016-06-20 18:24:56 -07:00
Fahri Cihan Demirci
db0176b884 Add Purge Subcommand Completion for Apt (#3097) 2016-06-20 18:23:12 -07:00
Fabian Homborg
f63f6e54fa Make string match -rnv work
Fixes #3098.
2016-06-20 18:21:45 -07:00
Jens Fredskov
7cf6ef675a correct __fish_contains_opts to __fish_contains_opt (#3102)
Completion throws and error about the command `__fish_contains_opts` beings unknown. It seems to be a simple typo, as all other completions use `__fish_contains_opt`
2016-06-20 18:16:10 -07:00
Fabian Homborg
29664c42a0 git completions: Ignore stderr everywhere
This allows us to run git commands outside of a git repo.

Fixes #3114.
2016-06-20 18:11:26 -07:00
Fabian Homborg
8dc4b0d4b2 Merge pull request #3123 from moverest/completion
Extend autocompletion support
2016-06-20 18:05:01 -07:00
Boris Aranovich
cb74f0f60e Refine reading ssh_config (#3146)
https://www.freebsd.org/cgi/man.cgi?query=ssh_config&sektion=5
1. It is possible to add multiple whitespace characters between the keyword (i.e. Host) and the argument(s).
2. It is allowed to have a single = and whitespace between the keyword and the argument(s).
3. It is possible to add multiple host names under a single Host directive by spacing the names apart.

1. and 3. are actual conventions that we use in our team, and I couldn't get auto-complete working for fish without this modification.

Modification explained:
a. The space between Host(?:name)? and the \w.* was replaced by (?:\s+|\s*=\s*) to match any sequence of whitespace characters, or optional whitespaces with a single =, per spec.
b. Result of first replacement is piped through another string replace to switch duplicate whitespace characters to a single space, and then piped to be split by that space. This allows specifying several aliases or host names in a single Host/Hostname definition, also per spec.
2016-06-20 17:06:45 -07:00
Kurtis Rader
d8dd718695 remove unset vars from the environment
Remove vars from the environment that are no longer set. Simplify the code by
removing an unnecessary loop. Add some tests.

Fixes #3124
2016-06-20 17:00:36 -07:00
Kurtis Rader
4424909801 simplify, and fix, setting the current locale
Fix test setup bogosities. Specifically, they weren't hermetic with respect to
locale env vars.

Rewrite the handling of locale vars to simplify the code and make it more like
the pattern most programs employ.

Fixes #3110
2016-06-20 16:54:34 -07:00
Kurtis Rader
a243580cfa tty driver ignore lnext (\cV) and werase (\cW)
Configure the tty driver to ignore the lnext (\cV) and werase (\cW) characters
so they can be bound to fish functions.

Correct the `fish_key_bindings` program to initialize the tty in the same
manner as the `fish` program.

Fixes #3064
2016-06-20 14:28:14 -07:00
Aaron Gyes
693d6879d3 Travis: restore clang with trusty & included clang
Upgraded to using Tavis trusty dist (from precise)

Ubuntu's clang is only 3.4 though.

For fancy address, thread-sanitizer stuff, easier to do on OS X.
We can use the clang that comes with xcode 8 beta.
2016-06-20 03:27:32 -07:00
Aaron Gyes
ad7e9a8d56 Travis: clang 3.5.0 on Linux
https://docs.travis-ci.com/user/trusty-ci-environment

all trusty images have sudo, and actually it is required
to use this new Travis environment per docs. This makes
it actually do it. Clang is 3.5 now.
2016-06-20 03:24:23 -07:00
Fabian Homborg
d0fdc82fdf Tests: Add fish_mode_prompt to except_prompt
Without this, the interactive tests fail when they receive a mode_prompt
in vi-mode.
2016-06-20 11:30:10 +02:00
Kurtis Rader
82c56bc64b deal with broken ttys on MS Windows
The tty device timestamps on MS Windows aren't usable because they're always
the current time. So fish can't use them to decide if the entire prompt needs
to be repainted.

Fixes #2859
2016-06-19 22:05:01 -07:00
Kurtis Rader
098f6d01c4 enhance the key_reader program
The original `key_reader` program was useful but didn't do much that `xxd`
or `od -tx1z` didn't do. Furthermore, it wasn't built and installed by
default. This change adds features that make it superior to those programs
for decoding interactive key presses and makes it a first-class citizen
like the `fish_indent` program that is always available.

Fixes #2991
2016-06-19 19:43:45 -07:00
Fabian Homborg
fcbeddc3eb Remove $__fish_vi_mode
This makes fish_mode_prompt rely on $fish_key_bindings instead.

fish_bind_mode is also set in default mode (only always "default"), so
it can't be used as the indicator.

Closes #3067.

(cherry picked from commit 8ab980b793)
2016-06-06 22:21:52 +08:00
David Adam
216a45edee Bump version for VERSION 2016-05-20 22:48:00 +00:00
David Adam
7828f2303a osx/config.h: update to match current configure output 2016-05-20 22:44:47 +00:00
David Adam
245be2c2e4 CHANGELOG: update for 2.3.0 2016-05-20 22:37:30 +00:00
Jorge Bucaran
14b953e414 Add missing color definitions to __fish_init_1_50_0 reset. (#2987)
* Add missing color definitions to __fish_init_1_50_0 reset.

The values where determined by inspecting the values of:

* fish_color_end
* fish_color_user
* fish_color_host

after resetting the color theme via fish_config.

* Add documentation for fish_color_user and fish_color_host.

(cherry picked from commit 08c29727e0)
2016-05-20 21:02:56 +00:00
ridiculousfish
ade6ebf522 Update docs to reflect new if/while condtion chaining
Documents new behavior in #1428

Cherry picked from 30ea7cc3f8
2016-05-19 13:03:06 -07:00
ridiculousfish
768277a312 Remove the errant newline in __fish_cancel_commandline again
(cherry picked from commit 149e601743)
2016-05-13 23:19:53 +01:00
Daniel Bergmann
c53951b9b3 Add tags to completion list for git show. (#2998)
(cherry picked from commit ac47100a7d)
2016-05-08 14:07:32 +02:00
Fabian Homborg
46b819a265 docs: Mention cartesian product in variable-expansion section
See #3002.

(cherry picked from commit 1d101ef3d0)
2016-05-08 14:07:32 +02:00
[Redacted]
4d1e77fcae Added completions for rmmod (#3007)
(cherry picked from commit 59c8800c4d)
2016-05-08 14:07:32 +02:00
Vladimír Čunát
4efd0dfd65 docs: fix location of generated_completions (#3010)
(cherry picked from commit 100eef4e42)
2016-05-08 14:07:32 +02:00
Alexey Alekhin
c1e15ef084 FAQ: Synchronise code to add fish to /etc/shells with README
(cherry picked from commit 01e5ca5c96)

Signed-off-by: David Adam <zanchey@ucc.gu.uwa.edu.au>
2016-05-07 07:57:03 +01:00
Elis Axelsson
8ec81393a3 Change abbr to allow non-letter keys (#2996)
(cherry picked from commit 1c6f6df2b3)
2016-05-06 16:17:01 +02:00
David Adam
49838c768d bump version for 2.3b2 2016-05-05 06:02:57 +08:00
David Adam
862e0127f6 CHANGELOG: update for 2.3b2 2016-05-05 06:02:52 +08:00
Kurtis Rader
1cd4731c2d don't use colors when writing the ^C indicator
There was an extended discussion in https://github.com/fish-shell/fish-shell/issues/2904 about using a bright yellow background to make the cancelled command indicator, ^C, standout. The upshot was that standout (i.e., reversing fg/bg colors) mode should be used until themes are agumented with proper support for background colors and special characters.

(cherry picked from commit a897ef0025)
2016-04-30 12:31:57 -07:00
Fabian Homborg
05a432da32 Remove using_command from netctl completions
This allows `; and netctl` to work.

First step towards #2705.
2016-04-30 16:51:49 +02:00
Fabian Homborg
404ab5e9ab git completion: Allow optional "+" for push
This signifies a force-push.

To avoid cluttering, only complete branches if a + is already given.

Fixes #2879.

(cherry picked from commit fde26d4049)
2016-04-30 16:35:14 +02:00
Fabian Homborg
901652d5c3 Add repository/refspec completion to git
A few commands (fetch, pull and push at least) take a "repository" (aka
"remote") and then a "refspec" (we currently do branches here).

Fixes #2525 (seems that man is still alive)

(cherry picked from commit b32bf22616)
2016-04-30 16:35:14 +02:00
Kurtis Rader
4bb805b5fe document new fish_realpath builtin 2016-04-29 21:47:43 -07:00
Kurtis Rader
52731c480c provide a realpath implementation
Not all distros have a `realpath` command. Provide a function that uses the
real command if available else use the fish builtin.

Fixes #2932

(cherry picked from commit 6c329e8a83)
2016-04-29 21:30:26 -07:00
Kurtis Rader
f44ef3ad3f fix bind unit tests
In my rush to get the fix for the wrong default Vi mode escape delay merged
(commit 3e24ae80b3) I neglected to update the
unit test. This change corrects that oversight.

Cherry-picked from 5092904ea3
2016-04-29 15:55:39 -07:00
Kurtis Rader
54319435f4 clarify fish_vi_mode deprecation warning
Also, correct the Vi mode default escape timeout. I intended it to be 100 ms
in my previous change but it ended up 10 ms which is far too short. A 10 ms
delay will continue to cause problems for people running fish inside `screen`,
`tmux`, or over high latency connections.

Cherry-picked from 3e24ae80b3
2016-04-29 15:52:10 -07:00
ridiculousfish
8e19c82e09 Issue a \r in fish_title, except when executing it for the prompt
fish_title currently outputs some escaped text, which can confuse
the line driver (#2453). Issue a carriage return so the line driver
knows we are at the beginning of the line, unless we are writing
the title as part of the prompt. In that case, we may have text from
the previous command still on the line and we don't want to move the
cursor.

Fixes #2453
2016-04-29 12:33:06 -07:00
Sanne Wouda
09bb713989 git takes --help even when it needs a command (#2984)
`git --help` is a valid command and fish should complete it as such
2016-04-29 12:59:04 +02:00
Fabian Homborg
6466ffe82d git completion: Only show unmerged branches for cherry-pick 2016-04-29 12:59:04 +02:00
Kurtis Rader
ce41e3468e add way to comment/uncomment a command
Fixes #2375

(cherry picked from commit 2f8d0e9aba)
2016-04-28 14:58:15 +08:00
David Adam
75064ed786 fish.spec: hostname dependency for openSUSE
As discussed in
ed4b78918a

[ci skip]
2016-04-28 08:20:58 +08:00
Michael Steed
5f4a77a324 Update usage of pcre2_substitute() for pcre2-10.21
- Set PCRE2_SUBSTITUTE_OVERFLOW_LENGTH to get the required buffer length
  from pcre2 instead of guessing
- Set PCRE2_SUBSTITUTE_EXTENDED to enable extra goodies in the
  replacement string

(cherry picked from commit c2f9d60eb1)
2016-04-27 21:50:18 +08:00