From bf3466d82c5256cc22f454edbfef3d374ea11a3b Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 18 Oct 2016 22:02:56 +0800 Subject: [PATCH 01/22] Update osx/config.h Regenerated with current autoconf tests for OS X El Capitan. This avoids portability problems introduced with 8b9102d9feff0eebc9957fa1cce46e7b5c3aecad and partially reverts that commit. --- osx/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osx/config.h b/osx/config.h index f273f679f..30cac1f8e 100644 --- a/osx/config.h +++ b/osx/config.h @@ -5,7 +5,7 @@ #define HAVE_BACKTRACE_SYMBOLS 1 /* Define to 1 if you have the `clock_gettime' function. */ -#define HAVE_CLOCK_GETTIME 1 +/* #undef HAVE_CLOCK_GETTIME */ /* Define to 1 if you have the header file. */ #define HAVE_CURSES_H 1 @@ -51,7 +51,7 @@ #define HAVE_MEMORY_H 1 /* Define to 1 if you have the `mkostemp' function. */ -#define HAVE_MKOSTEMP 1 +/* #undef HAVE_MKOSTEMP */ /* Define to 1 if you have the header file. */ /* #undef HAVE_NCURSES_CURSES_H */ From 9c85dce863e876b24bfbb5b8e76b6d0c3475eb0a Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 18 Oct 2016 22:16:46 +0800 Subject: [PATCH 02/22] CHANGELOG: last minute addition --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e56b963c..5a2509e2d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,7 +37,7 @@ - `p4`, the Perforce client (#3314) - `pygmentize` (#3378) - `ranger` (#3378) -- Improved completions for `aura` (#3297), `abbr` (#3267), `brew` (#3309), `chown` (#3380, #3383),`cygport` (#3392), `git` (#3274, #3226, #3225, #3094, #3087, #3035, #3021, #2982, #3230), `kill & `pkill` (#3200) `screen` (#3271), and `xz` (#3378). +- Improved completions for `aura` (#3297), `abbr` (#3267), `brew` (#3309), `chown` (#3380, #3383),`cygport` (#3392), `git` (#3274, #3226, #3225, #3094, #3087, #3035, #3021, #2982, #3230), `kill & `pkill` (#3200), `screen` (#3271), `wget` (#3470), and `xz` (#3378). - Distributors, packagers and developers will notice that the build process produces more succinct output by default; use `make V=1` to get verbose output (#3248). - Improved compatibility with minor platforms including musl (#2988), Cygwin (#2993), Android (#3441, #3442), Haiku (#3322) and Solaris . From e9543617f63d2a96c358d19f672441c9d6f7780c Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 18 Oct 2016 22:06:13 +0800 Subject: [PATCH 03/22] Bump version for 2.4b1 --- CHANGELOG.md | 2 +- osx/Info.plist | 2 +- osx/config.h | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a2509e2d..3a40065d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# next-2.x +# fish 2.4b1 (released October 18, 2016) ## Significant changes - The clipboard integration has been revamped with explicit bindings. The killring commands no longer copy from, or paste to, the X11 clipboard - use the new copy (`C-x`) and paste (`C-v`) bindings instead. The clipboard is now available on OS X as well as systems using X11 (e.g. Linux). (#3061) diff --git a/osx/Info.plist b/osx/Info.plist index dbbcc6398..0f6f3a944 100644 --- a/osx/Info.plist +++ b/osx/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.3.500 + 2.3.900 CFBundleVersion 0.1 LSApplicationCategoryType diff --git a/osx/config.h b/osx/config.h index 30cac1f8e..c481274e2 100644 --- a/osx/config.h +++ b/osx/config.h @@ -167,7 +167,7 @@ #define PACKAGE_NAME "fish" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "fish 2.3.1-git" +#define PACKAGE_STRING "fish 2.4b1" /* 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.1-git" +#define PACKAGE_VERSION "2.4b1" /* The size of `wchar_t', as computed by sizeof. */ #define SIZEOF_WCHAR_T 4 From 31432c3535216fde1effe1d49e8a4e1979808e0b Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Sat, 22 Oct 2016 18:23:03 -0700 Subject: [PATCH 04/22] Revert "Fix lexicon_filter verbosity" This reverts commit dcb39af8c0860abea04bce9d5fa502fd7ba9e2b6. It breaks building the documentation because splitting the sed invocation in the `lexicon_filter` target from the preceding `if` block means the `WORDBL` and `WORDBR` shell vars aren't available. (cherry picked from commit 100a0ea549ba6909328d2eccf98d2524c3fd6e18) --- Makefile.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index adea719c5..ee373324d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -453,9 +453,8 @@ lexicon_filter: lexicon.txt lexicon_filter.in | show-SED WORDBL='[[:<:]]'; WORDBR='[[:>:]]'; \ else \ WORDBL='\\<'; WORDBR='\\>'; \ - fi - $v $(SED) >$@.tmp -n -e "s|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,$$WORDBL\2$$WORDBR,@\1{\2},g|p" -e '$$G;s/.*\n/b tidy/p' - $v mv $@.tmp $@; test -x $@ || chmod a+x $@; + fi; $(SED) >$@.tmp -n -e "s|^\([a-z][a-z][a-z][a-z]\) \([a-z_-]*\)$$|s,$$WORDBL\2$$WORDBR,@\1{\2},g|p" -e '$$G;s/.*\n/b tidy/p'; + mv $@.tmp $@; test -x $@ || chmod a+x $@; # From 8af6bb44367f3d7ad25c7b163afe17ae1915821c Mon Sep 17 00:00:00 2001 From: Fabian Weisshaar Date: Fri, 21 Oct 2016 13:56:45 +0200 Subject: [PATCH 05/22] add listFilesystems to diskutil completion (cherry picked from commit e16f6ca2aa15c2638ffd57e2eda9c3ad41319e2b) --- share/completions/diskutil.fish | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/share/completions/diskutil.fish b/share/completions/diskutil.fish index 89e1c61e7..86315ade9 100644 --- a/share/completions/diskutil.fish +++ b/share/completions/diskutil.fish @@ -1,4 +1,4 @@ -#completion for diskutil +# completion for diskutil (macOS) function __fish_diskutil_devices set -l mountpoints /dev/disk*; printf '%s\n' $mountpoints @@ -22,6 +22,10 @@ complete -f -c diskutil -n '__fish_seen_subcommand_from info' -o 'all' -d 'Proce # activity complete -f -c diskutil -n '__fish_use_subcommand' -a activity -d 'Continuously display system-wide disk manipulation activity' +# listFilesystems +complete -f -c diskutil -n '__fish_use_subcommand' -a listFilesystems -d 'Show the file system personalities available' +complete -f -c diskutil -n '__fish_seen_subcommand_from listFilesystems' -o 'plist' -d 'Return a property list' + # umount complete -f -c diskutil -n '__fish_use_subcommand' -a umount -d 'Unmount a single volume' complete -f -c diskutil -n '__fish_seen_subcommand_from umount' -a '(__fish_diskutil_mounted_volumes)' From 7fdbbe07119b3ea623f058eb5c0d2571a026063c Mon Sep 17 00:00:00 2001 From: Fabian Weisshaar Date: Fri, 21 Oct 2016 13:57:13 +0200 Subject: [PATCH 06/22] add defaults (macOS) completion (cherry picked from commit 7878dbc4f05c3b602567d6cf0cc0e6af48ed51b5) --- share/completions/defaults.fish | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 share/completions/defaults.fish diff --git a/share/completions/defaults.fish b/share/completions/defaults.fish new file mode 100644 index 000000000..6df6e6dd4 --- /dev/null +++ b/share/completions/defaults.fish @@ -0,0 +1,33 @@ +# completion for defaults (macOS) + +function __fish_defaults_domains + defaults domains | string split ", " +end + +complete -f -c defaults -o 'currentHost' -d 'Restricts preferences operations to the host the user is currently logged in on' +complete -f -c defaults -o 'host' -d 'Restricts preferences operations to hostname' + +# read +complete -f -c defaults -n '__fish_use_subcommand' -a read -d 'Shows defaults for all or the given domain' +complete -f -c defaults -n '__fish_seen_subcommand_from read read-type write rename delete' -a '(__fish_defaults_domains)' +complete -f -c defaults -n '__fish_seen_subcommand_from read read-type write rename delete' -o 'app' + +# write +complete -f -c defaults -n '__fish_use_subcommand' -a write -d 'Writes domain or or a key in the domain' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'string' -d 'String as the value for the given preference key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'data' -d 'Abunch of raw data bytes as the value for the given prefer ence key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'int' -d 'Integer as the value for the given preference key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'float' -d 'Floating point number as the value for the given preference key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'bool' -d 'Boolean as the value for the given preference key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'date' -d 'Date as the value for the given preference key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'array' -d 'Array as the value for the given preference key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'array-add' -d 'Allows to add new elements to the end of an array' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'dict' -d 'Dictionary to the defaults database for a domain' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'dict-add' -d 'Allows to add new key/value pairs to a dictionary' + +complete -f -c defaults -n '__fish_use_subcommand' -a read-type -d 'Shows the type for the given domain, key' +complete -f -c defaults -n '__fish_use_subcommand' -a rename -d 'Renames old_key to new_key' +complete -f -c defaults -n '__fish_use_subcommand' -a delete -d 'Deletes domain or a key in the domain' +complete -f -c defaults -n '__fish_use_subcommand' -a domains -d 'Prints the names of all domains in the users defaults system' +complete -f -c defaults -n '__fish_use_subcommand' -a find -d 'Searches for word in the domain names, keys, and values of the users defaults' +complete -f -c defaults -n '__fish_use_subcommand' -a help -d 'Prints a list of possible command formats' From 5a8be619543e81a8c8614ffef1860ef43d3f8313 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Sat, 22 Oct 2016 12:34:15 -0700 Subject: [PATCH 07/22] defaults completions: shorten and improve brevity At 80 columns the description obscured 'find' in 'default find'. Improve others. (cherry picked from commit cbe2d4b5f120802788bc839b2fa57b9b91293447) --- share/completions/defaults.fish | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/share/completions/defaults.fish b/share/completions/defaults.fish index 6df6e6dd4..408bfe688 100644 --- a/share/completions/defaults.fish +++ b/share/completions/defaults.fish @@ -4,30 +4,30 @@ function __fish_defaults_domains defaults domains | string split ", " end -complete -f -c defaults -o 'currentHost' -d 'Restricts preferences operations to the host the user is currently logged in on' +complete -f -c defaults -o 'currentHost' -d 'Restricts preferences operations to the current logged-in host' complete -f -c defaults -o 'host' -d 'Restricts preferences operations to hostname' # read -complete -f -c defaults -n '__fish_use_subcommand' -a read -d 'Shows defaults for all or the given domain' +complete -f -c defaults -n '__fish_use_subcommand' -a read -d 'Shows defaults entire given domain' complete -f -c defaults -n '__fish_seen_subcommand_from read read-type write rename delete' -a '(__fish_defaults_domains)' complete -f -c defaults -n '__fish_seen_subcommand_from read read-type write rename delete' -o 'app' # write complete -f -c defaults -n '__fish_use_subcommand' -a write -d 'Writes domain or or a key in the domain' -complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'string' -d 'String as the value for the given preference key' -complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'data' -d 'Abunch of raw data bytes as the value for the given prefer ence key' -complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'int' -d 'Integer as the value for the given preference key' -complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'float' -d 'Floating point number as the value for the given preference key' -complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'bool' -d 'Boolean as the value for the given preference key' -complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'date' -d 'Date as the value for the given preference key' -complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'array' -d 'Array as the value for the given preference key' -complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'array-add' -d 'Allows to add new elements to the end of an array' -complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'dict' -d 'Dictionary to the defaults database for a domain' -complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'dict-add' -d 'Allows to add new key/value pairs to a dictionary' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'string' -d 'String as the value for the given key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'data' -d 'Raw data bytes for given key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'int' -d 'Integer as the value for the given key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'float' -d 'Floating point number as the value for the given key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'bool' -d 'Boolean as the value for the given key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'date' -d 'Date as the value for the given key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'array' -d 'Array as the value for the given key' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'array-add' -d 'Add new elements to the end of an array' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'dict' -d 'Add a dictionary to domain' +complete -f -c defaults -n '__fish_seen_subcommand_from write' -o 'dict-add' -d 'Add new key/value pairs to a dictionary' complete -f -c defaults -n '__fish_use_subcommand' -a read-type -d 'Shows the type for the given domain, key' complete -f -c defaults -n '__fish_use_subcommand' -a rename -d 'Renames old_key to new_key' complete -f -c defaults -n '__fish_use_subcommand' -a delete -d 'Deletes domain or a key in the domain' complete -f -c defaults -n '__fish_use_subcommand' -a domains -d 'Prints the names of all domains in the users defaults system' -complete -f -c defaults -n '__fish_use_subcommand' -a find -d 'Searches for word in the domain names, keys, and values of the users defaults' +complete -f -c defaults -n '__fish_use_subcommand' -a find -d 'Searches for word in domain names, keys, and values' complete -f -c defaults -n '__fish_use_subcommand' -a help -d 'Prints a list of possible command formats' From 070ef6fd5b9544320881f4668f658e2c8be60d39 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Tue, 25 Oct 2016 20:56:15 -0700 Subject: [PATCH 08/22] fix regression introduced by commit 851e449 My earlier attempt with commit 851e449 to eliminate all the compiler warnings about mixing signed and unsigned ints in an expression introduced a subtle bug. This fixes that mistake. Fixes #3488 (cherry picked from commit 075be74cc4252a60df0ef24a4d68d064896b1344) --- src/pager.cpp | 12 ++++++------ src/pager.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pager.cpp b/src/pager.cpp index b6663a24b..0c9a37606 100644 --- a/src/pager.cpp +++ b/src/pager.cpp @@ -84,16 +84,15 @@ static int print_max(const wcstring &str, highlight_spec_t color, int max, bool /// Print the specified item using at the specified amount of space. line_t pager_t::completion_print_item(const wcstring &prefix, const comp_t *c, size_t row, - size_t column, size_t width, bool secondary, bool selected, + size_t column, int width, bool secondary, bool selected, page_rendering_t *rendering) const { UNUSED(column); UNUSED(row); UNUSED(rendering); - size_t comp_width = 0, desc_width = 0; - size_t written = 0; + int comp_width, desc_width; line_t line_data; - if (c->pref_width <= (size_t)width) { + if (c->pref_width <= width) { // The entry fits, we give it as much space as it wants. comp_width = c->comp_width; desc_width = c->desc_width; @@ -102,8 +101,8 @@ line_t pager_t::completion_print_item(const wcstring &prefix, const comp_t *c, s // the space to the completion, and whatever is left to the description. int desc_all = c->desc_width ? c->desc_width + 4 : 0; - comp_width = maxi(mini(c->comp_width, 2 * (width - 4) / 3), width - desc_all); - if (c->desc_width) desc_width = width - comp_width - 4; + comp_width = maxi(mini((int)c->comp_width, 2 * (width - 4) / 3), width - desc_all); + desc_width = c->desc_width ? width - 4 - comp_width : 0; } int bg_color = secondary ? highlight_spec_pager_secondary : highlight_spec_normal; @@ -111,6 +110,7 @@ line_t pager_t::completion_print_item(const wcstring &prefix, const comp_t *c, s bg_color = highlight_spec_search_match; } + int written = 0; for (size_t i = 0; i < c->comp.size(); i++) { const wcstring &comp = c->comp.at(i); diff --git a/src/pager.h b/src/pager.h index 3f7bfce0d..1376e51e7 100644 --- a/src/pager.h +++ b/src/pager.h @@ -114,7 +114,7 @@ class pager_t { const wcstring &prefix, const comp_info_list_t &lst, page_rendering_t *rendering) const; line_t completion_print_item(const wcstring &prefix, const comp_t *c, size_t row, size_t column, - size_t width, bool secondary, bool selected, + int width, bool secondary, bool selected, page_rendering_t *rendering) const; public: From 9f23f619c9722621d86dd064a4901babf48279f9 Mon Sep 17 00:00:00 2001 From: David Adam Date: Sun, 30 Oct 2016 14:22:51 +0800 Subject: [PATCH 09/22] Makefile: pass correct version macro Fixes display of version in documentation header. A shell-style variable instead of a Makefile-style variable left it displayed as ISH_BUILD_VERSION. (cherry picked from commit 1e234f492c05f73c38a554a036bcf600ea9310fd) --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index ee373324d..67ad88145 100644 --- a/Makefile.in +++ b/Makefile.in @@ -386,7 +386,7 @@ toc.txt: $(HDR_FILES:index.hdr=index.hdr.in) | show-SED @echo " SED $(em)$@$(sgr0)" $v rm -f toc.tmp $@ # Ugly hack to set the toc initial title for the main page - $v echo '- fish shell documentation - $FISH_BUILD_VERSION' > toc.tmp + $v echo '- fish shell documentation - $(FISH_BUILD_VERSION)' > toc.tmp # The first sed command captures the page name, followed by the description # The second sed command captures the command name \1 and the description \2, but only up to a dash # This is to reduce the size of the TOC in the command listing on the main page From 7bcae096742ee6dd3cd62101273ef8255f33736a Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 27 Oct 2016 10:16:57 +0200 Subject: [PATCH 10/22] Disable vi-cursor on xterm < 282 Fixes #3499. @zanchey: This is for integration-2.4.0. (cherry picked from commit 7ea2dc448819b4a1cb7c846554754d8785a421e0) --- share/functions/fish_vi_cursor.fish | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/share/functions/fish_vi_cursor.fish b/share/functions/fish_vi_cursor.fish index be04eb430..47fa7467b 100644 --- a/share/functions/fish_vi_cursor.fish +++ b/share/functions/fish_vi_cursor.fish @@ -6,6 +6,17 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes' and not set -q TMUX return end + + # XTerm supports this sequence since version 282 + if test -n "$XTERM_VERSION" + # This will fail if $XTERM_VERSION is not in the "XTerm($version)" format. + # In that case, we cannot determine the terminal and should stop + # so "[1 q" does not show up on the user's screen + if not test (string replace -r 'XTerm\((\d*)\)' '$1' -- $XTERM_VERSION) -ge 282 + return + end + end + set -l terminal $argv[1] set -q terminal[1] or set terminal auto From c8fe0e53dd752544945d549f219034de18cc90c8 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 27 Oct 2016 23:04:12 +0200 Subject: [PATCH 11/22] Rework cursor detection Fixes #3499. (cherry picked from commit 2a5ad198bf9e7f2c5a9b927e3dcf7496217a00ac) --- share/functions/fish_vi_cursor.fish | 58 ++++++++++++++++++++--------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/share/functions/fish_vi_cursor.fish b/share/functions/fish_vi_cursor.fish index 47fa7467b..c1eef1bfe 100644 --- a/share/functions/fish_vi_cursor.fish +++ b/share/functions/fish_vi_cursor.fish @@ -1,20 +1,44 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes' - # Since we read exported variables (KONSOLE_PROFILE_NAME and ITERM_PROFILE) - # we need to check harder if we're actually in a supported terminal, - # because we might be in a term-in-a-term (emacs ansi-term). - if not contains -- $TERM xterm konsole xterm-256color konsole-256color - and not set -q TMUX - return - end - - # XTerm supports this sequence since version 282 - if test -n "$XTERM_VERSION" - # This will fail if $XTERM_VERSION is not in the "XTerm($version)" format. - # In that case, we cannot determine the terminal and should stop - # so "[1 q" does not show up on the user's screen - if not test (string replace -r 'XTerm\((\d*)\)' '$1' -- $XTERM_VERSION) -ge 282 - return + # Check hard if we are in a supporting terminal. + # + # Challenges here are term-in-a-terms (emacs ansi-term does not support this, tmux does), + # that we can only figure out if we are in konsole/iterm/vte via exported variables, + # and ancient xterm versions. + # + # tmux defaults to $TERM = screen, but can do this if it is in a supporting terminal. + # Unfortunately, we can only detect this via the exported variables, so we miss some cases. + # + # We will also miss some cases of terminal-stacking, + # e.g. tmux started in suckless' st (no support) started in konsole. + # But since tmux in konsole seems rather common and that case so uncommon, + # we will just fail there (though it seems that tmux or st swallow it anyway). + # + # We use the `tput` here just to see if terminfo thinks we can change the cursor. + # We cannot use that sequence directly as it's not the correct one for konsole and iTerm, + # and because we may want to change the cursor even though terminfo says we can't (tmux). + if not tput Ss > /dev/null + # Whitelist tmux... + and not begin + set -q TMUX + # ...in a supporting term... + and begin set -q KONSOLE_PROFILE_NAME + or set -q ITERM_PROFILE + or test "$VTE_VERSION" -gt 1910 + end + # .. unless an unsupporting terminal has been started in tmux inside a supporting one + and begin string match -q "screen*" -- $TERM + or string match -q "tmux*" -- $TERM + end end + and not string match -q "konsole*" -- $TERM + # Blacklist + or begin + # vte-based terms set $TERM = xterm*, but only gained support relatively recently. + set -q VTE_VERSION + and test "$VTE_VERSION" -le 1910 + end + or set -q INSIDE_EMACS + return end set -l terminal $argv[1] @@ -29,11 +53,9 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes' or set -q ITERM_PROFILE set function __fish_cursor_konsole set uses_echo 1 - else if string match -q "xterm*" -- $TERM; or test "$VTE_VERSION" -gt 1910 + else set function __fish_cursor_xterm set uses_echo 1 - else - return 1 end case konsole set function __fish_cursor_konsole From ddbf63c46f5e1cef9cd1e69c24a676cabe5146ec Mon Sep 17 00:00:00 2001 From: David Adam Date: Mon, 31 Oct 2016 22:35:36 +0800 Subject: [PATCH 12/22] CHANGELOG: updates for 2.4.0 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a40065d7..708d81b4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# fish 2.4.0 (released ???) + +There are no major changes between 2.4b1 and 2.4.0. + +## Notable fixes and improvements +- The documentation is now generated properly and with the correct version identifier. +- Automatic cursor changes are now only enabled on the subset of XTerm versions known to support them, resolving a problem where older versions printed garbage to the terminal before and after every prompt (#3499). +- Added completions for `defaults` and improved completions for `diskutil` (#3478). + # fish 2.4b1 (released October 18, 2016) ## Significant changes From dfe7813c029fbafc5ea00d2fef6c5c4aa0ba52d7 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Sat, 22 Oct 2016 10:47:46 -0700 Subject: [PATCH 13/22] Fix Terminal.app title Defining fish_title here is too late because there will already be a title set. Work around issue by clearing it at same time. --- share/functions/__fish_config_interactive.fish | 1 + 1 file changed, 1 insertion(+) diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index 691593379..4f57c95c6 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -220,6 +220,7 @@ function __fish_config_interactive -d "Initializations that should be performed # Notify terminals when $PWD changes (issue #906) # VTE and Terminal.app support this in practice. if test "0$VTE_VERSION" -ge 3405 -o "$TERM_PROGRAM" = "Apple_Terminal" + echo -n \e\]0\;\a # clear existing title function fish_title; end function __update_cwd_osc --on-variable PWD --description 'Notify capable terminals when $PWD changes' status --is-command-substitution From b2f047421de0ac9fc89de74e26fc22cd0a10531b Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Sun, 23 Oct 2016 11:58:29 -0700 Subject: [PATCH 14/22] Supress fish_title only for Terminal.app VTE terminals apparently do not use the OSC sequence to compose title components. --- share/functions/__fish_config_interactive.fish | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index 4f57c95c6..c7143dd65 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -220,14 +220,18 @@ function __fish_config_interactive -d "Initializations that should be performed # Notify terminals when $PWD changes (issue #906) # VTE and Terminal.app support this in practice. if test "0$VTE_VERSION" -ge 3405 -o "$TERM_PROGRAM" = "Apple_Terminal" - echo -n \e\]0\;\a # clear existing title - function fish_title; end function __update_cwd_osc --on-variable PWD --description 'Notify capable terminals when $PWD changes' status --is-command-substitution or test -n "$INSIDE_EMACS" and return printf \e\]7\;file://\%s\%s\a (hostname) (echo -n $PWD | __fish_urlencode) end + if test "$TERM_PROGRAM" = "Apple_Terminal" + # Suppress duplicative title display on Terminal.app + echo -n \e\]0\;\a # clear existing title + function fish_title + end + end __update_cwd_osc # Run once because we might have already inherited a PWD from an old tab end From a5f6382d770b80b3755435ce1e66288e9e3332bf Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Mon, 31 Oct 2016 12:03:09 -0700 Subject: [PATCH 15/22] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 708d81b4d..4fb763e38 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ There are no major changes between 2.4b1 and 2.4.0. ## Notable fixes and improvements - The documentation is now generated properly and with the correct version identifier. - Automatic cursor changes are now only enabled on the subset of XTerm versions known to support them, resolving a problem where older versions printed garbage to the terminal before and after every prompt (#3499). +- Fixed a problem that rendered terminal titles inoperable on VTE. - Added completions for `defaults` and improved completions for `diskutil` (#3478). # fish 2.4b1 (released October 18, 2016) From 9701d5cc7b8e4a7caf62b1136954930f8a3e1cf0 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Mon, 31 Oct 2016 21:19:50 -0700 Subject: [PATCH 16/22] sorin right prompt: reset color at end bold mode being left enabled was causing issues in the pager. --- share/tools/web_config/sample_prompts/sorin.fish | 1 + 1 file changed, 1 insertion(+) diff --git a/share/tools/web_config/sample_prompts/sorin.fish b/share/tools/web_config/sample_prompts/sorin.fish index cab4b8c58..59c80c2dd 100644 --- a/share/tools/web_config/sample_prompts/sorin.fish +++ b/share/tools/web_config/sample_prompts/sorin.fish @@ -49,5 +49,6 @@ function fish_right_prompt printf (set_color white)◼' ' end end + set_color normal end end From c18614552de19f66dcd337801e66ef49a647e767 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Mon, 31 Oct 2016 23:29:50 -0700 Subject: [PATCH 17/22] Sorin prompt: updates Use $USER, prompt_hostname, string Update to use correct color names such as magenta over purple. Use bright color variants instead of bold in some cases. --- .../web_config/sample_prompts/sorin.fish | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/share/tools/web_config/sample_prompts/sorin.fish b/share/tools/web_config/sample_prompts/sorin.fish index 59c80c2dd..9bc07d751 100644 --- a/share/tools/web_config/sample_prompts/sorin.fish +++ b/share/tools/web_config/sample_prompts/sorin.fish @@ -2,7 +2,7 @@ # author: Ivan Tham function fish_prompt - test $SSH_TTY; and printf (set_color red)(whoami)(set_color white)'@'(set_color yellow)(hostname)' ' + test $SSH_TTY; and printf (set_color red)$USER(set_color brwhite)'@'(set_color yellow)(prompt_hostname)' ' test $USER = 'root'; and echo (set_color red)"#" @@ -15,10 +15,10 @@ function fish_right_prompt test $status != 0; and printf (set_color red)"⏎ " if git rev-parse ^ /dev/null - # Purple if branch detached else green - git branch -qv | grep "\*" | grep -q detached - and set_color purple --bold - or set_color green --bold + # Magenta if branch detached else green + git branch -qv | grep "\*" | string match -rq detached + and set_color brmagenta + or set_color brgreen # Need optimization on this block (eliminate space) git name-rev --name-only HEAD @@ -32,9 +32,9 @@ function fish_right_prompt (git status --porcelain | cut -c 1-2 | uniq) switch $i case "*[ahead *" - printf (set_color purple)⬆' ' + printf (set_color magenta)⬆' ' case "*behind *" - printf (set_color purple)⬇' ' + printf (set_color magenta)⬇' ' case "." printf (set_color green)✚' ' case " D" @@ -42,13 +42,12 @@ function fish_right_prompt case "*M*" printf (set_color blue)✱' ' case "*R*" - printf (set_color purple)➜' ' + printf (set_color brmagenta)➜' ' case "*U*" - printf (set_color brown)═' ' + printf (set_color bryellow)═' ' case "??" - printf (set_color white)◼' ' + printf (set_color brwhite)◼' ' end end - set_color normal end end From 01fb830bf5f5a62770344a7ee2262dd1a0dea294 Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Mon, 31 Oct 2016 23:43:20 -0700 Subject: [PATCH 18/22] Revert "Sorin prompt: updates" This reverts commit c18614552de19f66dcd337801e66ef49a647e767. --- .../web_config/sample_prompts/sorin.fish | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/share/tools/web_config/sample_prompts/sorin.fish b/share/tools/web_config/sample_prompts/sorin.fish index 9bc07d751..59c80c2dd 100644 --- a/share/tools/web_config/sample_prompts/sorin.fish +++ b/share/tools/web_config/sample_prompts/sorin.fish @@ -2,7 +2,7 @@ # author: Ivan Tham function fish_prompt - test $SSH_TTY; and printf (set_color red)$USER(set_color brwhite)'@'(set_color yellow)(prompt_hostname)' ' + test $SSH_TTY; and printf (set_color red)(whoami)(set_color white)'@'(set_color yellow)(hostname)' ' test $USER = 'root'; and echo (set_color red)"#" @@ -15,10 +15,10 @@ function fish_right_prompt test $status != 0; and printf (set_color red)"⏎ " if git rev-parse ^ /dev/null - # Magenta if branch detached else green - git branch -qv | grep "\*" | string match -rq detached - and set_color brmagenta - or set_color brgreen + # Purple if branch detached else green + git branch -qv | grep "\*" | grep -q detached + and set_color purple --bold + or set_color green --bold # Need optimization on this block (eliminate space) git name-rev --name-only HEAD @@ -32,9 +32,9 @@ function fish_right_prompt (git status --porcelain | cut -c 1-2 | uniq) switch $i case "*[ahead *" - printf (set_color magenta)⬆' ' + printf (set_color purple)⬆' ' case "*behind *" - printf (set_color magenta)⬇' ' + printf (set_color purple)⬇' ' case "." printf (set_color green)✚' ' case " D" @@ -42,12 +42,13 @@ function fish_right_prompt case "*M*" printf (set_color blue)✱' ' case "*R*" - printf (set_color brmagenta)➜' ' + printf (set_color purple)➜' ' case "*U*" - printf (set_color bryellow)═' ' + printf (set_color brown)═' ' case "??" - printf (set_color brwhite)◼' ' + printf (set_color white)◼' ' end end + set_color normal end end From e4ce5ca24fb5b65bbd4995620f2c740a4de0cd9d Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Mon, 31 Oct 2016 23:43:46 -0700 Subject: [PATCH 19/22] Revert "sorin right prompt: reset color at end" This reverts commit 9701d5cc7b8e4a7caf62b1136954930f8a3e1cf0. --- share/tools/web_config/sample_prompts/sorin.fish | 1 - 1 file changed, 1 deletion(-) diff --git a/share/tools/web_config/sample_prompts/sorin.fish b/share/tools/web_config/sample_prompts/sorin.fish index 59c80c2dd..cab4b8c58 100644 --- a/share/tools/web_config/sample_prompts/sorin.fish +++ b/share/tools/web_config/sample_prompts/sorin.fish @@ -49,6 +49,5 @@ function fish_right_prompt printf (set_color white)◼' ' end end - set_color normal end end From c9c311fbdb3cc515e0428460ce51d0a70fd9baef Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Thu, 3 Nov 2016 08:27:48 +0100 Subject: [PATCH 20/22] fish_vi_cursor: Ignore errors from tput Fixes #3519. (cherry picked from commit b9b66791c1b6eb2226df301be916f2b2d1e042d0) --- share/functions/fish_vi_cursor.fish | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/functions/fish_vi_cursor.fish b/share/functions/fish_vi_cursor.fish index c1eef1bfe..1ab8ef25f 100644 --- a/share/functions/fish_vi_cursor.fish +++ b/share/functions/fish_vi_cursor.fish @@ -16,7 +16,7 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes' # We use the `tput` here just to see if terminfo thinks we can change the cursor. # We cannot use that sequence directly as it's not the correct one for konsole and iTerm, # and because we may want to change the cursor even though terminfo says we can't (tmux). - if not tput Ss > /dev/null + if not tput Ss > /dev/null ^/dev/null # Whitelist tmux... and not begin set -q TMUX From 0b0d0e77992e37e19a69375a3c4496e76eef6b5c Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 8 Nov 2016 11:01:55 +0800 Subject: [PATCH 21/22] CHANGELOG: updates for 2.4.0 --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fb763e38..af77636a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,11 @@ -# fish 2.4.0 (released ???) +# fish 2.4.0 (released November 8, 2016) There are no major changes between 2.4b1 and 2.4.0. ## Notable fixes and improvements - The documentation is now generated properly and with the correct version identifier. - Automatic cursor changes are now only enabled on the subset of XTerm versions known to support them, resolving a problem where older versions printed garbage to the terminal before and after every prompt (#3499). -- Fixed a problem that rendered terminal titles inoperable on VTE. +- Improved the title set in Apple Terminal.app. - Added completions for `defaults` and improved completions for `diskutil` (#3478). # fish 2.4b1 (released October 18, 2016) From 54360d8cfe20cc3d7a5e58d3d8bed824a4168ec3 Mon Sep 17 00:00:00 2001 From: David Adam Date: Tue, 8 Nov 2016 11:06:13 +0800 Subject: [PATCH 22/22] Bump version for 2.4.0 --- osx/Info.plist | 2 +- osx/config.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/osx/Info.plist b/osx/Info.plist index 0f6f3a944..8df377d23 100644 --- a/osx/Info.plist +++ b/osx/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.3.900 + 2.4.0 CFBundleVersion 0.1 LSApplicationCategoryType diff --git a/osx/config.h b/osx/config.h index c481274e2..d2622bf69 100644 --- a/osx/config.h +++ b/osx/config.h @@ -167,7 +167,7 @@ #define PACKAGE_NAME "fish" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "fish 2.4b1" +#define PACKAGE_STRING "fish 2.4.0" /* 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.4b1" +#define PACKAGE_VERSION "2.4.0" /* The size of `wchar_t', as computed by sizeof. */ #define SIZEOF_WCHAR_T 4