1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-13 01:31:18 +02:00
Commit graph

276 commits

Author SHA1 Message Date
Peter Stephenson
9408c4825b users/23472: Add $sysparams[procsubstpid] to zsh/system 2018-06-15 15:02:36 +01:00
Peter Stephenson
1d2f684c9b 42793: Always define FDT_PROC_SUBST even if not needed.
This avoids proliferating #ifdef's.
2018-05-17 10:00:37 +01:00
Peter Stephenson
758966502c 42322 (tweaked): Fix interactive_comments history with just a coment.
Don't discard the line from the history merely because it produced
no synactic words.
2018-01-24 17:40:56 +00:00
Peter Stephenson
36fcaeb167 42245: Abort last word on interactve comment.
Last recorded word should be the previous one.
2018-01-08 17:26:33 +00:00
Peter Stephenson
5f6a52c06c 42156: new CHECK_RUNNING_JOBS option demanded by bash groupies
Also new job options.

Also suppress debug error if rows or columns are reported as zero as
this is normal without a physical terminal.
2017-12-22 20:21:23 +00:00
Peter Stephenson
8ec3d17b4b 33395: Improvments for function managment.
Functions defined inside other fucntions needs file line number
adding.  Particularly useful for anonymous fucntions.

Add flag to indicate a function is anonymous.  Done up to now
by comparing the name to a pointer but this is more consistent.
2017-12-22 19:51:04 +00:00
Peter Stephenson
728f2adfc8 Add typeset -p1, like typeset -p with newlines 2017-10-01 17:53:56 +01:00
Peter Stephenson
6230e82d44 41764 (test tweaked): allow [key]+=value when modifying arrays 2017-09-27 09:41:50 +01:00
Peter Stephenson
7d4b41b52a 41747: Don't create hash entry if just checking existence.
Pass a flag in indicating this case.
2017-09-25 20:03:05 +01:00
Peter Stephenson
85b0dd7133 Updates for ksh array element syntax.
Move detection of key/value pairs down into prefork().

Detect normal array assignment and [key]=val array assignemnt
separately.  Mark key / value pairs with Marker and pass up flag.  Deal
with marked triads specially later on.
2017-09-24 17:33:07 +01:00
Peter Stephenson
54b3958440 First go at var=([key]=value) syntax.
Works for both normal and typeset case, also var+=...

Still to do: allow to be mixed with straight array assignment,
improve typeset -p, implement [key]+=value.
2017-09-13 20:54:00 +01:00
Peter Stephenson
2ef3dff65a 41668: New --emulate option on invocation.
This sets the shell emulation mode similarly to ARGV0=... which
doesn't work from other shells.

Note that this gives more comprehensive emulation than running
emulate within the shell.
2017-09-11 10:12:17 +01:00
Peter Stephenson
97d4bdbc7e 41590 modified as 41595: make ERR_RETURN more logical.
It now operates separately at each function depth.

To keep ERR_EXIT global, make the noerrexit variable usd bit flags.

Extend tests.
2017-08-24 19:46:20 +01:00
Peter Stephenson
ddb8675901 posted but has not shown up: fix fd problem in subshell.
Record fd's that have been saved in fdtable and if the shell
forks close them as they will never be restored.
2017-08-15 20:49:23 +01:00
Sebastian Gniazdowski
e556f9c78d 41402: Add hasher to ecstrcode to reduce string comparisons 2017-07-09 17:34:55 +01:00
Peter Stephenson
a955065cda Delay processing "disown" for superjob.
This is a job forked from the current shell when a job partly
running from the current shell was suspended.  When all associated
processes started from the main shell are finished the job is
continued and at this point the disown can complete.
2017-07-04 09:40:45 +01:00
Peter Stephenson
d4947e67cc 41239: Save and restore default history event on context stack.
This ensures that the default event set by an expansion in ZLE
doesn't propagate to the command line expansion.
2017-06-07 10:03:41 +01:00
Peter Stephenson
151a4660e2 41164: Don't free a history entry if it's curline.
This replaces 41113 / 94014ff65b with a simple local change for the
immediate problem.  It's not entirely clear if this reflects wider
changes in the structure of the history code.
2017-05-30 09:39:32 +01:00
Peter Stephenson
94014ff65b 41113 (tweaked): Save current line linkage to history ring.
When saving history state save whether the current history line
is linked into the ring and remove it, and restore as appropriate
later.  This avoids surprises where the history ring is freed
and incorrectly frees the current state in curline, which has
a different allocation strategy.

Original patch tweaked to make restoring more logical.
2017-05-18 09:33:08 +01:00
Jun-ichi Takimoto
171e7fa4c1 41090: Replace iswprint() if unicode9 is enabled.
If wcwidth() or iswprint() is broken, force enable unicode9.
2017-05-12 12:10:13 +09:00
Peter Stephenson
f3f8537cfa 40760: Always tokenize unquoted - to Dash.
This fixes use of pattern match character ranges in unusual contexts.

Attempt to detect a tokenized - in cases where we don't care.
2017-03-07 10:43:58 +00:00
Peter Stephenson
f5272bccd8 40536: Prepend directory to $fpath.
Used if parent function is autoloaded by absolute path so
as to find functions in the same suite without shell code
modification.
2017-02-13 16:32:50 +00:00
Barton E. Schaefer
0672c75359 40439: PAT_HEAPDUP definition just for clarity 2017-01-28 15:37:27 -08:00
Peter Stephenson
c861b17bbf 40391: Add WARN_NESTED_VAR option and functions -W.
These are companions to WARN_CREATED_GLOBAL, warning when a variable
from an enclosing scope is altered.
2017-01-23 09:50:57 +00:00
Peter Stephenson
33799ae2b0 40335: More care with autoload function path.
If doing "autoload -X", the path present might actually be location
of file containing the function with the autoload -X.  Add
an explicit flag to say it's a directory for autoload.
2017-01-12 13:54:29 +00:00
Peter Stephenson
f26d1ba6b0 Add features associated with autoloading a function using an absolute
path.

-d defaults to normal fpath

-r remembers the path without actually loading.  May be combined with -d.

-R does the same but it's an error if not found

-X can now take a directory path: this is used to output not yet loaded
functions that have an associated path.
2017-01-11 11:26:13 +00:00
Peter Stephenson
bb218704d2 40306 with doc tweaks: Change behaviour expanding alias in () function definition.
Now an error unless the () is part of the same error as the name.
Add ALIAS_FUNC_DEF option to allow it again.
2017-01-10 19:14:26 +00:00
Oliver Kiddle
7630215ba0 40119: correct typo in comment 2016-12-08 23:55:53 +01:00
Peter Stephenson
c03228f9ed Extra case for ERR_RETURN and ERR_EXIT.
Don't trigger just because status is non-zero at end of
complex shell construct as this may be a case we've already
suppressed.
2016-12-05 11:21:01 +00:00
Joshua Rubin
596ba302e6 40037: Unicode 9 character width support.
Enable with --enable-unicode9.
2016-11-29 17:19:53 +00:00
Eitan Adler
110ffae9fe 40035: Cosmetic fixes for comments and documentation.
Mostly fixes to doubled words.
2016-11-29 17:13:52 +00:00
Peter Stephenson
36a11804b4 39521: Refactor start of execcmd().
By splitting into _analyse and _exec execpline2() has easier
access to the state at the start of execution.  Use this
to ensure we fork if this is a builtin with no arguments.
2016-10-03 09:59:01 +01:00
Peter Stephenson
d08674ef8c 39498: use PRIVILEGED option to decide on problematic parameter imports 2016-09-30 10:41:44 +01:00
Peter Stephenson
b32d974000 39460: Don't import PS4 if running as root.
There was an exploit in bash using SHELLOPTS to turn on xtrace,
however this can't happen in zsh, so this is simply a precaution.
2016-09-28 09:50:58 +01:00
Peter Stephenson
01ae64c0d7 39331: Reparent subjob on fork with exited superjob.
Fixes case of
  v() { { vim - } always { true } }
  ls | v
  ^Z
  fg

Tentative fix: still a race at exit where zsh forked by ^Z
is stopped when restarted.
2016-09-16 09:39:33 +01:00
Peter Stephenson
a4b8ee13be zsh-users/21903: Fix ${...?...} in interactive shell.
On failure should abort back to top level, but we reset the error
flag around commands.  Add a hard error flag that's only reset at top level.
2016-09-14 10:33:18 +01:00
Peter Stephenson
1993a3cd2a 39292: Distinguish "=" and "==" tests in output.
This is both in xtrace output and shell code rebuilt from
internal structures.
2016-09-13 09:42:24 +01:00
Peter Stephenson
fe3a63fa6c 39181: Add PM_SINGLE and use for compstate.
This flags that compstate (or any other special) can only have
a single instance and an attempt to create a new one is an error.
Given the very fiddly semantics of compstate any other usage
seems pointless.

No investigation yet of other variables that could use this.

Note it's still possible to hide such variables; only instances
that keep the special nature are affected.
2016-09-06 09:42:33 +01:00
Oliver Kiddle
e87aa8941f 38809: fix tracking of colour attributes and restore them when turning bold off 2016-07-08 22:28:15 +02:00
Daniel Shahaf
bced1beb8c 37700: Teach ${(z)} the 'repeat WORD SUBLIST' syntax. 2016-01-29 09:14:53 +00:00
Peter Stephenson
ad16356e19 37689: ! and ^ need to be tokenised in character sets 2016-01-19 17:24:12 +00:00
Peter Stephenson
8eb9070d67 37678: Now possible to quote "-" in pattern range 2016-01-19 09:55:46 +00:00
Peter Stephenson
f5b8efa7e0 37344: restore old printable quoting, add ${(q+)...}.
The \C- form is only used inside quotedzputs().

${(q+)...} outputs a quotedzputs() representation.
2015-12-07 21:49:07 +00:00
Peter Stephenson
5a76a5d34e 37314: upgrade quotedzputs() for non-printable output.
Use nicechar with $'..' quoting; upgrade nicechar() etc. to
use suitable output.
2015-12-06 15:33:02 +00:00
Peter Stephenson
830d54e629 37092: make nested ${(P)name} properly refer to parameter on return 2015-11-11 18:04:20 +00:00
Peter Stephenson
58f4cccb1f 37022: add GLOB_STAR_SHORT option to abbreviate ** and *** 2015-10-30 12:28:07 +00:00
Peter Stephenson
0628802baf 37014: Improved internal parameter setting.
Enhance WARNCREATEGLOBAL to work in many more cases.

Don't create REPLY as an integer if it didn't previously exist
as one, even if the value to be set is integral, as this is likely to
mess up later uses of REPLY.
2015-10-29 15:01:07 +00:00
Peter Stephenson
1f6dcf9bcd 36941: Mark file descripors in ztcp as used.
Allow such file descriptors to be either internal and closed on exec
or external and so managed explicitly by module.
2015-10-24 20:24:35 +01:00
Peter Stephenson
d07783628e 36700: unmetafy early for parameter match 2015-09-29 19:47:21 +01:00
Peter Stephenson
f9d7651c25 36682: expand pattern interface to optimise unmetafication 2015-09-28 20:31:51 +01:00