Merge branch 'Integration_2.3.1'

Includes the `string` fallbacks for upgrades from 2.3.1 (as discussed in
issue #3057).
This commit is contained in:
David Adam 2016-07-03 22:18:55 +08:00
commit 3cd1ef23ab
4 changed files with 77 additions and 23 deletions

View File

@ -2,21 +2,30 @@
## Significant changes
- The clipboard integration has been revamped with explicit bindings. OS X clipboard support provided for out of the box in addition to X11. (#3061)
# fish 2.3.1 (unreleased)
---
# fish 2.3.1 (released July 3, 2016)
This is a functionality and bugfix release. This release does not contain all the changes to fish since the last release, but fixes a number of issues directly affecting users at present and includes a small number of new features.
## Significant changes
- The `key_reader` utility was renamed to `fish_key_reader` and is now built by default. (#2991)
- A new `fish_key_reader` binary for decoding interactive keypresses (#2991).
- `fish_mode_prompt` has been updated to reflect the changes in the way the Vi input mode is set up (#3067), making this more reliable.
- `fish_config` can now properly be launched from the OS X app bundle (#3140).
## Other notable fixes and improvements
- Paper over mayhem caused with missing `string` builtin while old versions of fish are still running moments after upgrading to fish 2.3 (#3057, #3065, #3125, #3141)
- Fish is less confused about locales now than it was when 2.3.0 was released. (#3124, )
- `fish_config` didn't work in fish.app (OS X) if one didn't already have fish installed by some other means. (#3140)
## Notable fixes and improvements
- Extra lines were sometimes inserted into the output under Windows (Cygwin and Microsoft Windows Subsystem for Linux) due to TTY timestamps not being updated (#2859).
- The `string` builtin's `match` mode now handles the combination of `-rnv` (match, invert and count) correctly (#3098).
- Improvements to TTY special character handling (#3064), locale handling (#3124) and terminal environment variable handling (#3060).
- Work towards handling the terminal modes for external commands launched from initialisation files (#2980).
- Ease the upgrade path from fish 2.2.0 and before by warning users to restart fish if the `string` builtin is not available (#3057).
- `type -a` now syntax-colorizes function source output.
- Improvements to `suspend` function (#3154),
- New completions for: alsamixer, godoc, gofmt, goimports, golint, gorename, ip, lscpu, mkdir, modinfo, netctl-auto, networkctl, poweroff, termite, udisksctl, xz
- Added completions for `alsamixer`, `godoc`, `gofmt`, `goimports`, `gorename`, `lscpu`, `mkdir`, `modinfo`, `netctl-auto`, `poweroff`, `termite`, `udisksctl` and `xz` (#3123).
- Improved completions for `apt` (#3097), `aura` (#3102),`git` (#3114), `npm` (#3158), `string` and `suspend` (#3154).
---
##Known issues
# fish 2.3.0 (released May 20, 2016)
There are no significant changes between 2.3.0 and 2.3b2.

View File

@ -167,7 +167,7 @@
#define PACKAGE_NAME "fish"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "fish 2.3.0-git"
#define PACKAGE_STRING "fish 2.3.1-git"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "fish"
@ -176,7 +176,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
#define PACKAGE_VERSION "2.3.0-git"
#define PACKAGE_VERSION "2.3.1-git"
/* The size of `wchar_t', as computed by sizeof. */
#define SIZEOF_WCHAR_T 4

View File

@ -18,17 +18,36 @@ function __fish_default_command_not_found_handler
end
if status --is-interactive
# Enable truecolor/24-bit support for select terminals
if not set -q NVIM_LISTEN_ADDRESS # Neovim will swallow the 24bit sequences, rendering text white
and begin
set -q KONSOLE_PROFILE_NAME # KDE's konsole
or string match -q -- "*:*" $ITERM_SESSION_ID # Supporting versions of iTerm2 will include a colon here
or string match -q -- "st-*" $TERM # suckless' st
or test "$VTE_VERSION" -ge 3600 # Should be all gtk3-vte-based terms after version 3.6.0.0
or test "$COLORTERM" = truecolor -o "$COLORTERM" = 24bit # slang expects this
# The user has seemingly explicitly launched an old fish with
# too-new scripts installed.
if not contains "string" (builtin -n)
set -g __is_launched_without_string 1
# XXX nostring - fix old fish binaries with no `string' builtin.
# When executed on fish 2.2.0, the `else' block after this would
# force on 24-bit mode due to changes to in test behavior.
# These "XXX nostring" hacks were added for 2.3.1
set_color --bold
echo "You appear to be trying to launch an old fish binary with newer scripts "
echo "installed into" (set_color --underline)"$__fish_datadir"
set_color normal
echo -e "\nThis is an unsupported configuration.\n"
set_color yellow
echo "You may need to uninstall and reinstall fish!"
set_color normal
# Remove this code when we've made it safer to upgrade fish.
else
# Enable truecolor/24-bit support for select terminals
if not set -q NVIM_LISTEN_ADDRESS # (Neovim will swallow the 24bit sequences, rendering text white)
and begin
set -q KONSOLE_PROFILE_NAME # KDE's konsole
or string match -q -- "*:*" $ITERM_SESSION_ID # Supporting versions of iTerm2 will include a colon here
or string match -q -- "st-*" $TERM # suckless' st
or test "$VTE_VERSION" -ge 3600 # Should be all gtk3-vte-based terms after version 3.6.0.0
or test "$COLORTERM" = truecolor -o "$COLORTERM" = 24bit # slang expects this
end
# Only set it if it isn't to allow override by setting to 0
set -q fish_term24bit; or set -g fish_term24bit 1
end
# Only set it if it isn't to allow override by setting to 0
set -q fish_term24bit; or set -g fish_term24bit 1
end
else
# Hook up the default as the principal command_not_found handler
@ -189,7 +208,7 @@ for file in $configdir/fish/conf.d/*.fish $__fish_sysconfdir/conf.d/*.fish $__ex
end
# Upgrade pre-existing abbreviations from the old "key=value" to the new "key value" syntax
# This needs to be in share/config.fish because __fish_config_interactive is called after sourcing config.fish, which might contain abbr calls
# This needs to be in share/config.fish because __fish_config_interactive is called after 2sourcing config.fish, which might contain abbr calls
if not set -q __fish_init_2_3_0
set -l fab
for abb in $fish_user_abbreviations

View File

@ -0,0 +1,26 @@
# XXX nostring
if not contains string (builtin -n)
function string
if not set -q __is_launched_without_string
if status --is-interactive
# We've been autoloaded after fish < 2.3.0 upgraded to >= 2.3.1 - no string builtin
set_color --bold >&2
echo "Fish has been upgraded, and the scripts on your system are not compatible" >&2
echo "with this prior instance of fish. You can probably run:" >&2
set_color green >&2
echo -e "\n exec fish" >&2
set_color normal >&2
echo "… to replace this process with a new one in-place." >&2
set -g __is_launched_without_string 1
end
end
set PATH $__fish_bin_dir $PATH
set string_cmd string \'$argv\'
if fish -c 'contains string (builtin -n)'
fish -c "$string_cmd"
else
return 127
end
end
end