Commit Graph

6004 Commits

Author SHA1 Message Date
Aaron Gyes
84b08a4fe3 Merge branch 'Integration_2.3.1' of https://github.com/fish-shell/fish-shell into Integration_2.3.1 2016-06-30 21:30:46 -07:00
Kurtis Rader
c429a585e4 backport the latest fish_key_reader from master
This includes the improvements to `fish_key_reader` as of commit
68e167d576 on the master branch. This makes
the program much friendlier to users.
2016-06-30 21:21:10 -07:00
Kurtis Rader
68e167d576 f-k-r should use the user's locale
I did some research and experiments. For good or bad the `bind` command
requires the use of wide char codepoints (e.g., \u1234) for non-ASCII
chars.  So don't force the use of the POSIX locale, but do provide it as
an option for people who want to see the individual bytes rather than a
decoded wide char.

Simplify the format of the information displayed for each character. There
really isn't much point in providing decimal, octal, and hexadecimal. Just
print hex and symbolic representations.

Add an example `bind` command that a user can copy/paste.

Closes #3183
2016-06-30 20:49:56 -07:00
Kurtis Rader
262452d0b1 fix stupid copy/paste comment error from prev commit
When I fixed handling the TZ env var in commit dda890c I introduced a couple
of silly copy/paste comment errors. This corrects those comments.
2016-06-28 21:25:25 -07:00
Benjamin Barenblat
7e08679f1b history: Add option to show timestamps
Closes #677.
2016-06-28 19:46:54 -07:00
Kurtis Rader
dda890cf88 reset timezone state when TZ env var changes
When the TZ env var is modified change fish's internal timezone state.

Fixes #3181.
2016-06-28 18:06:39 -07:00
Aaron Gyes
44cde9e0e9 fish_key_reader #includes need to be updated 2016-06-28 02:57:14 -07:00
Kurtis Rader
d7bc20c933 don't allow f-k-r to run if stdin/stdout not a tty
Another developer noticed that redirecting stdin of `fish_key_reader`
results in weird behavior.  Which is not at all surprising. So add checks
to ensure stdin and stdout are attached to a tty.

Add some rudimentary unit tests for this program.
2016-06-26 21:51:00 -07:00
Aaron Gyes
d69a68e265 Comment fixes. 2016-06-26 21:14:45 -07:00
Aaron Gyes
534c1287ca Add back prompt_pwd to solve empty output problem
..by not manipulating path at all if we do not have
the tools to do so.

Tag changes with better comments.
2016-06-26 20:54:04 -07:00
Aaron Gyes
81dee16d69 Add back prompt_pwd to solve empty output problem
..by not manipulating path at all if we do not have
the tools to do so.

Tag changes with better comments.
2016-06-26 20:25:11 -07:00
Kurtis Rader
e5011fbcdf fix fish_key_reader.cpp so it builds on linux 2016-06-26 17:38:19 -07:00
Kurtis Rader
0f5bfeead2 add more ways to exit fish_key_reader
A discussion on Gitter proposed allowing the user to signal their desire to
exit fish_key_reader by pressing \cC or \cD twice in a row. This implements
that.

I also decided to refactor how signals are handled. Most notably receiving a
signal will no longer print a diagnostic message unless you've enabled
debugging with `-d2` (or higher level).
2016-06-26 17:12:03 -07:00
David Adam
a47b4b0e95 Rewrite error messages for incorrect TERM
(cherry picked from commit 0f3b4d2bd8)
2016-06-27 07:42:57 +08:00
Aaron Gyes
02f578a82d echo the no-string errors to stderr and return 1.
Fix output on launch

Drop __fish_urlencode.fish

Drop prompt_pwd.fish
2016-06-26 16:25:41 -07:00
Aaron Gyes
dfb4998778 Work around absent `string' in old fishies upgrading.
Improves experience during upgrades, accidentally running
an old fish with a new environment. No errors just from
printing a prompt. Fixes #3057.

Print helpful notice also when launching mismatched fish.

Autoloadable string.fish -- only create function if not builtin.
2016-06-26 16:25:41 -07:00
Fabian Homborg
ea71f0b610 Reword variable expansion docs 2016-06-26 11:36:31 +02:00
Fabian Homborg
a3e9e179eb Document fish_mode_prompt 2016-06-26 11:36:31 +02:00
David Adam
0f3b4d2bd8 Rewrite error messages for incorrect TERM 2016-06-26 16:24:01 +08:00
David Adam
ceee1ebfd9 update osx/config.h to match current configure output 2016-06-26 13:33:22 +08:00
Kurtis Rader
046174397b fix setting the fish_key_reader locale
In addition to fixing the setting of the locale to C/POSIX this also
corrects several problems introduced by the commits made in the past
couple of days.  As a consequence of dealing with all of this I decided
to refactor the code to simplify one of the overly long functions I
introduced in my previous change.

Fixes #3168
2016-06-25 19:55:49 -07:00
Aaron Gyes
a6ec2dc3ed Remove oopsies while pasting.
(also, last commit log had a typo. "3.4.0-Microsoft" is the string we
should check for. Actual string in my code was correct.)
2016-06-25 01:10:58 -07:00
Aaron Gyes
6ec83568b5 Check for "Windows-3.4.0" as per MS's suggestion.
https://github.com/Microsoft/BashOnWindows/issues/545

Just looking for "Mirosoft" is rather general - we don't want to
enforce this strange behavior for Windows 12 (or the next beta.)
2016-06-25 00:31:46 -07:00
Kurtis Rader
b2a2705df4 croak if gettimeofday() fails
There is no conceivable way in which timef()'s invocation of gettimeofday()
can fail where it makes sense to continue running.  Yes, one such,
legitimate, failure mode is a 32-bit kernel and the date is greater than
2038-01-19 03:14:07. If you're running a fish binary on such a system
it's time to upgrade.  Otherwise, either the hardware or OS is broken.

Fixes #3167.
2016-06-24 19:32:46 -07:00
Aaron Gyes
0d6bdb38e6 Style fixes. 2016-06-23 22:48:45 -07:00
ridiculousfish
02cef2da23 history --merge to properly interleave items
Fixes #2312
2016-06-23 22:03:07 -07:00
Aaron Gyes
9c53019d95 fish_key_reader: ms were off by factor of ten.
Improve output.
2016-06-23 21:10:31 -07:00
Aaron Gyes
7a4065eb9f std::isnan() 2016-06-23 20:20:49 -07:00
Aaron Gyes
13eb302f3c proc_init() doesn't need to be called.
I don't know why I added that, that's how "bogosities" are born.
2016-06-23 18:28:49 -07:00
Aaron Gyes
6122ae83a6 Remove inadvertent change in fish_tests.cpp 2016-06-23 17:36:20 -07:00
Aaron Gyes
fa78a7101c Make IWYU output in lint.cpp less messy
And re-run IWYU, adjust #includes.
2016-06-23 17:26:08 -07:00
bgeron-g
5d680f6dbc Fix typo 2016-06-23 18:23:10 +02:00
Aaron Gyes
290e936322 Fix up key_reader
* Correct notice about ^C
* Move time deltas to end of the line away from the important info on
  left.
* Use timef() instead of gettimteofday() ourselves
* Show time in ms (is this even useful in any unit? Maybe testing escape
  delays...)
* Make init more similar to other apps.
2016-06-23 07:43:55 -07:00
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
Aaron Gyes
db2c128b24 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 10:30:53 -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
10661bb024 npm completions: Check command npm existence
Really fixes #3158 and #3152.
2016-06-21 17:42:22 +02:00
Fabian Homborg
f9edcbbbe2 Document clipboard bindings. 2016-06-21 16:25:11 +02:00
Fabian Homborg
7365b6bd0c Bind clipboard-copy to \cx, restore yank binding
Fixes #3160.
2016-06-21 16:19:40 +02:00
Fabian Homborg
d66d51f101 systemctl completions: Add reset-failed completion
Fixes #3153.
2016-06-21 12:43:50 +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
3a0d417b9e npm completions: Call command npm
npm is often wrapped by a function.

Fixes #3158.
2016-06-21 12:03:29 +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