Commit 7b75d97c authored by Axel Beckert's avatar Axel Beckert

New upstream release 5.7

Merge branch 'upstream' at 'zsh-5.7' into branch debian
parents 95401e83 9799d0f9
2018-01-24 dana <dana@dana.is>
* unposted: Config/version.mk, README: Update for 5.7
2018-01-23 dana <dana@dana.is>
* 44012: Test/X04zlehighlight.ztst: Fix spurious test failures
on OpenBSD
2019-01-23 Mikael Magnusson <mikachu@gmail.com>
* 44011: Doc/Zsh/zle.yo, Src/prompt.c, Test/X04zlehighlight.ztst:
Only use fg_start_code for non-truecolor
2018-01-21 dana <dana@dana.is>
* 44001: Completion/Zsh/Context/_brace_parameter: Complete (q+)
2018-01-18 dana <dana@dana.is>
* 43990: Completion/Linux/Command/_opkg: Support gain-privileges
2019-01-08 Peter Stephenson <p.stephenson@samsung.com>
* users/23829: Completion/Unix/Type/_path_files,
Doc/Zsh/compsys.yo: Add and document file-split-chars style.
2018-01-05 dana <dana@dana.is>
* unposted: Config/version.mk, NEWS: Update for 5.6.2-test-3
......
......@@ -35,6 +35,10 @@
# % zstyle ':completion:*:opkg:*' conf-paths <pattern> ...
# Set to one or more paths or glob patterns to override the defaults used when
# searching opkg configuration data.
#
# Elevated privileges may be necessary to complete package names, etc.; consider
# setting the gain-privileges style as follows:
# zstyle ':completion:*:(ipkg|opkg)/*' gain-privileges yes
##
# Check cache validity.
......@@ -105,7 +109,7 @@ _opkg_arch_prio() {
}
# Already configured arches
tmp=( ${(f)"$( _call_program architectures $svc print-architecture )"} )
tmp=( ${(f)"$( _call_program -p architectures $svc print-architecture )"} )
tmp=( ${${tmp##arch[ ]##}%% *} )
tmp+=(
......@@ -182,7 +186,9 @@ _opkg_pkg_all() {
{ (( ! $#_opkg_cache_pkg_all )) || _cache_invalid opkg-pkg-all } &&
! _retrieve_cache opkg-pkg-all && {
_opkg_cache_pkg_all=( ${(f)"$( _call_program pkg-all ${svc:-opkg} list )"} )
_opkg_cache_pkg_all=( ${(f)"$(
_call_program -p pkg-all ${svc:-opkg} list )"}
)
_opkg_cache_pkg_all=( ${(@)_opkg_cache_pkg_all##[[:space:]]*} )
_opkg_cache_pkg_all=( ${(@)_opkg_cache_pkg_all%%[[:space:]]*} )
_store_cache opkg-pkg-all _opkg_cache_pkg_all
......@@ -207,7 +213,7 @@ _opkg_pkg_inst() {
{ (( ! $#_opkg_cache_pkg_inst )) || _cache_invalid opkg-pkg-inst } &&
! _retrieve_cache opkg-pkg-inst && {
_opkg_cache_pkg_inst=( ${(f)"$(
_call_program pkg-inst ${svc:-opkg} list-installed
_call_program -p pkg-inst ${svc:-opkg} list-installed
)"} )
_opkg_cache_pkg_inst=( ${(@)_opkg_cache_pkg_inst##[[:space:]]*} )
_opkg_cache_pkg_inst=( ${(@)_opkg_cache_pkg_inst%%[[:space:]]*} )
......@@ -257,7 +263,7 @@ _opkg_pkg_upgr() {
{ (( ! $#_opkg_cache_pkg_upgr )) || _cache_invalid opkg-pkg-upgr } &&
! _retrieve_cache opkg-pkg-upgr && {
_opkg_cache_pkg_upgr=( ${(f)"$(
_call_program pkg-upgr ${svc:-opkg} list-upgradable
_call_program -p pkg-upgr ${svc:-opkg} list-upgradable
)"} )
_opkg_cache_pkg_upgr=( ${(@)_opkg_cache_pkg_upgr##[[:space:]]*} )
_opkg_cache_pkg_upgr=( ${(@)_opkg_cache_pkg_upgr%%[[:space:]]*} )
......
......@@ -2,6 +2,11 @@
local -a match mbegin mend
local splitchars
if zstyle -s ":completion:${curcontext}:" file-split-chars splitchars; then
compset -P "*[${(q)splitchars}]"
fi
# Look for glob qualifiers. Do this first: if we're really
# in a glob qualifier, we don't actually want to expand
# the earlier part of the path. We can't expand inside
......
......@@ -119,6 +119,7 @@ if [[ $PREFIX = *'${('[^\)]# ]]; then
flags+=(
"q:quote with single quotes"
"-:quote minimally for readability"
"+:quote like q-, plus \$'...' for unprintable characters"
)
;;
......
......@@ -27,5 +27,5 @@
# This must also serve as a shell script, so do not add spaces around the
# `=' signs.
VERSION=5.6.2-test-3
VERSION_DATE='January 5, 2019'
VERSION=5.7
VERSION_DATE='January 24, 2019'
......@@ -1568,6 +1568,16 @@ contains the string `tt(follow)', timestamps are associated with the
targets of symbolic links; the default is to use the timestamps
of the links themselves.
)
kindex(file-split-chars, completion style)
item(tt(file-split-chars))(
A set of characters that will cause em(all) file completions for
the given context to be split at the point where any of the characters
occurs. A typical use is to set the style to tt(:); then everything
up to and including the last tt(:) in the string so far is ignored when
completing files. As this is quite heavy-handed, it is usually
preferable to update completion functions for contexts where this
behaviour is useful.
)
kindex(filter, completion style)
item(tt(filter))(
The tt(ldap) plugin of email address completion (see tt(_email_addresses)) uses
......
......@@ -2671,7 +2671,9 @@ cindex(escape sequences, terminal, for highlighting)
cindex(terminal escape sequences for highlighting)
item(tt(fg_start_code) (tt(\e[3)))(
The start of the escape sequence for the foreground colour.
This is followed by an ASCII digit representing the colour.
This is followed by one to three ASCII digits representing the colour.
Only used for palette colors, i.e. not 24-bit colors specified via a
color triplet.
)
item(tt(fg_default_code) (tt(9)))(
The number to use instead of the colour to reset the default foreground
......@@ -2682,7 +2684,7 @@ The end of the escape sequence for the foreground colour.
)
item(tt(bg_start_code) (tt(\e[4)))(
The start of the escape sequence for the background colour.
This is followed by an ASCII digit representing the colour.
See tt(fg_start_code) above.
)
item(tt(bg_default_code) (tt(9)))(
The number to use instead of the colour to reset the default
......
......@@ -5,7 +5,8 @@ THE Z SHELL (ZSH)
Version
-------
This is version 5.7 of the shell.
This is version 5.7 of the shell. This is a stable release. There are
a few visible improvements since 5.6 as well as many bugfixes.
Note in particular the changes highlighted under "Incompatibilities since
5.6.2" below. See NEWS for more information.
......
......@@ -2018,11 +2018,13 @@ set_colour_attribute(zattr atr, int fg_bg, int flags)
/* Test if current zle_highlight settings are customized, or
* the typical "standard" codes */
if (0 != strcmp(fg_bg_sequences[fg_bg].start, fg_bg == COL_SEQ_FG ? "\e[3" : "\e[4") ||
0 != strcmp(fg_bg_sequences[fg_bg].def, "9") || /* the same in-fix for both FG and BG */
0 != strcmp(fg_bg_sequences[fg_bg].end, "m") /* the same suffix for both FG and BG */
) {
is_default_zle_highlight = 0;
if (0 != strcmp(fg_bg_sequences[fg_bg].start, fg_bg == COL_SEQ_FG ? TC_COL_FG_START : TC_COL_BG_START) ||
/* the same in-fix for both FG and BG */
0 != strcmp(fg_bg_sequences[fg_bg].def, TC_COL_FG_DEFAULT) ||
/* the same suffix for both FG and BG */
0 != strcmp(fg_bg_sequences[fg_bg].end, TC_COL_FG_END))
{
is_default_zle_highlight = 0;
}
/*
......@@ -2035,7 +2037,9 @@ set_colour_attribute(zattr atr, int fg_bg, int flags)
* highlighting variables, so much of this shouldn't be
* necessary at this point, but we might as well be safe.
*/
if (!def && !use_truecolor && (is_default_zle_highlight && (colour > 7 || use_termcap))) {
if (!def && !use_truecolor &&
(is_default_zle_highlight && (colour > 7 || use_termcap)))
{
/*
* We can if it's available, and either we couldn't get
* the maximum number of colours, or the colour is in range.
......@@ -2077,21 +2081,30 @@ set_colour_attribute(zattr atr, int fg_bg, int flags)
* or the typical true-color code: .start + 8;2;%d;%d;%d + .end
* or the typical 256-color code: .start + 8;5;%d + .end
*/
strcpy(colseq_buf, fg_bg_sequences[fg_bg].start);
if (use_truecolor)
strcpy(colseq_buf, fg_bg == COL_SEQ_FG ? TC_COL_FG_START : TC_COL_BG_START);
else
strcpy(colseq_buf, fg_bg_sequences[fg_bg].start);
ptr = colseq_buf + strlen(colseq_buf);
if (def) {
strcpy(ptr, fg_bg_sequences[fg_bg].def);
if (use_truecolor)
strcpy(ptr, fg_bg == COL_SEQ_FG ? TC_COL_FG_DEFAULT : TC_COL_BG_DEFAULT);
else
strcpy(ptr, fg_bg_sequences[fg_bg].def);
while (*ptr)
ptr++;
} else if (use_truecolor) {
ptr += sprintf(ptr, "8;2;%d;%d;%d", colour >> 16,
(colour >> 8) & 0xff, colour & 0xff);
} else if (colour > 7 && colour <= 255) {
ptr += sprintf(ptr, "8;5;%d", colour);
ptr += sprintf(ptr, "%d", colour);
} else
*ptr++ = colour + '0';
strcpy(ptr, fg_bg_sequences[fg_bg].end);
if (use_truecolor)
strcpy(ptr, fg_bg == COL_SEQ_FG ? TC_COL_FG_END : TC_COL_BG_END);
else
strcpy(ptr, fg_bg_sequences[fg_bg].end);
if (is_prompt) {
if (!bv->dontcount) {
......
......@@ -29,6 +29,8 @@
integer i
for (( i = 0; i < ${1:-1}; ++i )); do
zpty -r zsh REPLY
# Normalise me/sgr0 to \e[0m. We also need to strip \e(B in zpty_stop()
REPLY=${REPLY//${termcap[me]}/$'\x1b[0m'}
# P is for "preserve", and induces keeping some
# expected color codes to test region_highlight,
# etc. - the color codes are made a regular text.
......@@ -54,7 +56,12 @@
# zpty gives no output when piped without these braces (?)
# The while loop with // substitution is to convert `e^Mexit'
# into `exit' (see zpty_line). The sed commands remove escapes
{ zpty -r zsh } | sed -e $'/[^\t\r ]/!d' -e $'s/\r$//' -e $'s/\x1b\\[[0-9;]*m//g' | while read REPLY; do REPLY=${REPLY//(#b)((?(#c0,1))$cm(?(#c0,1)))/${${${(M)match[2]:#${match[3]}}:+${match[2]}}:-${${match[1]##[[:space:]]##}%%[[:space:]]##}}}; print -rn -- "$REPLY"; done
{ zpty -r zsh } |
sed -e $'/[^\t\r ]/!d' -e $'s/\r$//' -e $'s/\x1b\\[[0-9;]*m//g' -e $'s/\x1b([A-Z]//g' |
while read REPLY; do
REPLY=${REPLY//(#b)((?(#c0,1))$cm(?(#c0,1)))/${${${(M)match[2]:#${match[3]}}:+${match[2]}}:-${${match[1]##[[:space:]]##}%%[[:space:]]##}}}
print -rn -- "$REPLY"
done
zpty -d
:
}
......@@ -96,7 +103,7 @@
zpty_line 1 p # the line of interest, preserving escapes ("p")
zpty_stop
0:basic region_highlight with true-color (hex-triplets)
>0m27m24mCDE|38;2;4;8;16|trueCDE|39|
>0m27m24m38;2;4;8;16mtrueCDE|39|
zpty_start
zpty_input 'zmodload zsh/nearcolor'
......@@ -108,7 +115,7 @@
zpty_line 1 p # the line of interest, preserving escapes ("p")
zpty_stop
0:basic region_highlight with near-color (hex-triplets at input)
>0m27m24mCDE|38;5;232|trueCDE|39|
>0m27m24mCDE|3232|trueCDE|39|
zpty_start
zpty_input 'rh_widget() { BUFFER="true"; region_highlight+=( "0 4 fg=green" ); rh2; }'
......@@ -132,7 +139,7 @@
zpty_line 1 p # the line of interest, preserving escapes ("p")
zpty_stop
0:overlapping region_highlight with true-color
>0m27m24mCDE|38;2;0;204;0|tCDE|38;2;204;0;0|rCDE|39|CDE|38;2;0;204;0|ueCDE|39|
>0m27m24m38;2;0;204;0mt38;2;204;0;0mrCDE|39|38;2;0;204;0mueCDE|39|
zpty_start
zpty_input 'zmodload zsh/nearcolor'
......@@ -145,7 +152,7 @@
zpty_line 1 p # the line of interest, preserving escapes ("p")
zpty_stop
0:overlapping region_highlight with near-color (hex-triplets at input)
>0m27m24mCDE|38;5;40|tCDE|38;5;160|rCDE|39|CDE|38;5;40|ueCDE|39|
>0m27m24mCDE|340|tCDE|3160|rCDE|39|CDE|340|ueCDE|39|
%clean
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment