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

148 commits

Author SHA1 Message Date
Barton E. Schaefer
19b37ef565 35482: be consistent about how argzero is allocated 2015-06-16 17:02:53 -07:00
Barton E. Schaefer
89a689e693 34961: replace a couple of free() with zfree() for consistency 2015-04-25 10:48:43 -07:00
Peter Stephenson
c6c9f5daf2 34322: bug with interface to parsestr() etc.
Was showing up in places like ${(e)...} where command substitution
could reallocate the token string, but actually there was never any
guarantee that the lexer wouldn't do that, so this was always
a bit iffy.
2015-01-18 22:38:57 +00:00
Peter Stephenson
cfd91eac07 Rearrange context saving.
Variables are now associated with the module that declares them, being
initialised and saved/restored there.  However, as many variables are
used for communication between modules, many of them are set in multiple
places, so the assignment is ambiguous.
2015-01-09 21:33:39 +00:00
Peter Stephenson
c0d01a6fe0 Fix command substitutions to parse contents as they are read in.
Do this by refactoring misnamed lexsave()/lexrestore() to allow
continuity of history and input.

Add test.
2015-01-08 12:24:00 +00:00
Peter Stephenson
d067ebcacd 33876: etc.: Separate errors and keyboards interrupts
Combination of 12 commits from interrupt_abort branch.

Basic strategy is to introduce bits to errflag and to set and
reset them separately.

Remove interrupt status on return to main keymap.

Turn off ERRFLAG_INT for always block.

Restore bit thereafter: we probably need a new variable in order
to allow user interrupts to be reset in the always block.

Add TRY_BLOCK_INTERRUPT

This works the same as TRY_BLOCK_ERROR, but for a SIGINT, too.

Ensure propagation of SIGINT from exited job.

If received by foreground job, shell uses ERRFLAG_INT, not
ERRFLAG_ERROR, to set the new state.

Reset errflag before precmd()

Add always block in _main_completion to fix ZLS_COLORS

Ensures we get the right state of $ZLS_COLORS at the end of _main_complete
even if there's an interrupt.  However, the "right state" is a bit messy
as it depends on styles.
2014-12-11 09:41:17 +00:00
Peter Stephenson
b4f7ccecd9 33531 with additions: retain status of exited background jobs.
Add linked list of unwaited-for background jobs.
Truncate at value of _SC_CHILD_MAX discarding oldest.
Remove old lastpid_status mechanism for latest exited process only.
Slightly tighten safety of permanently allocated linked lists so
that this doesn't compromise signal handling.
2014-10-26 17:47:42 +00:00
Barton E. Schaefer
2d14c085b7 33445: fix handling of -s when combined with -i at shell invocation
Fixes a long-standing (25+ years) bug where using -i -s together did have
the documented effect of disabling command line script files but also had
the side-effect of invoking ZLE, thereby ignoring the redirected input.
2014-10-12 11:18:30 -07:00
Barton E. Schaefer
60e31a45b0 33268: interactive shells treat SIGPIPE like SIGHUP if and only if SHTTY is disconnected 2014-09-29 08:59:31 -07:00
Peter Stephenson
0c7a3d6864 33212: try to put /usr/local/share/zsh/site-functions in default fpath 2014-09-20 20:14:09 +01:00
Barton E. Schaefer
03e53c8f25 33143: POSIX_ARGZERO more closely matches bash et al. 2014-09-12 15:28:51 -07:00
Barton E. Schaefer
19f3161e51 32634: add POSIX_ARGZERO option 2014-06-01 15:01:37 -07:00
Barton E. Schaefer
ba58bfe4bf 32365: another stab at the heuristic for initializing rprompt_indent 2014-02-08 14:49:39 -08:00
Barton E. Schaefer
71b235bfa7 32341: heuristic initialization of ZLE_RPROMPT_INDENT 2014-02-02 14:07:23 -08:00
Barton E. Schaefer
3882c30f80 32340: improve error messages for "read -c" / "read -l" 2014-02-02 13:28:41 -08:00
Barton E. Schaefer
9cacf4411f 32157: fix extra line feed after prompt, and erased character in completion listing, when ZLE_RPROMPT_INDENT=0 2013-12-18 23:45:20 -08:00
Barton E. Schaefer
bcda34a0b3 32099: change pointer declaration to avoid arithmetic on (void *). 2013-12-10 14:22:10 -08:00
Barton E. Schaefer
c98cbe25d2 31919: fix deadlock when a shell builtin with a multio redirection is used on the left side of a pipeline
Make sure stdin/out/err file descriptors are closed for the multio copy
process, which means not re-using those descriptors after they are closed
and marked FDT_UNUSED in fdtable[].  For completeness, initialize their
fdtable[] state to FDT_EXTERNAL.
2013-10-27 15:42:00 -07:00
Bart Schaefer
4e43360261 31361: handle negative optno ("no" prefix used)
when storing options with parseopts_insert() for sticky contexts
2013-04-30 00:22:03 -07:00
Bart Schaefer
d19e18c68d 31350: block SIGWINCH nearly all the time, except
when about to calculate prompts or do synchronous read, so
syscalls are not interrupted by window size changes.
2013-04-30 00:08:49 -07:00
Peter Stephenson
7c56d77184 30789: Add CONTINUE_ON_ERROR for old behaviour.
New behaviour is for scripts to exit on error instead of returning
to top level and executing the next command.
2012-11-15 21:08:15 +00:00
Peter Stephenson
4b86cc48f7 30726: make shell options passed to emulate stick along with the emulation 2012-10-11 20:14:01 +00:00
Peter Stephenson
4e2cdd7956 30722: fix some cases where emulations or options were not propagated properly
from the emulate command
2012-10-07 19:46:46 +00:00
Peter Stephenson
eb562c9f2c 30715: use enum lextok for variables containing lexical tokens 2012-10-05 21:35:05 +00:00
Peter Stephenson
791ada572b add some braces to avoid compiler warnings 2012-03-30 11:01:11 +00:00
Bart Schaefer
fa8a0e241c 30320: "emulate" accepts invocation-time flags; other small doc tweaks. 2012-03-07 06:10:42 +00:00
Peter Stephenson
9b923cccea 30084: `zle -T tc func' for zle testing of termcap output 2012-01-05 20:01:24 +00:00
Peter Stephenson
731877dd78 30084: missing zsfree(argzero) 2012-01-04 17:50:11 +00:00
Peter Stephenson
d89361739a 29165: use term.h globally if needed at all. 2011-05-09 09:49:08 +00:00
Frank Terbeck
32974286d4 29008, 29012: Add --enable-additional-fpath' option to add arbitrary directories to the default $fpath'. 2011-04-18 20:36:31 +00:00
Bart Schaefer
90b83e028a users/15770 HASH_DIRS tracks INTERACTIVE 2011-02-11 04:04:05 +00:00
Peter Stephenson
a7bc22ca00 Paul 28538 / me 28540 / couple of unposted casts:
use char * for pointer arithmetic rather than void *
2010-12-20 10:28:43 +00:00
Peter Stephenson
76aef28b31 28073: allow #! scripts to search path if interpreter not found 2010-07-15 18:44:12 +00:00
Peter Stephenson
7850fc5a2c 28006: make zgetcwd() fall back to pwd,
only use "." if setting pwd
2010-06-08 08:51:03 +00:00
Peter Stephenson
09960dc5b9 27951: Add $ZSH_EVAL_CONTEXT and $zsh_eval_contxt 2010-05-12 10:06:59 +00:00
Peter Stephenson
53745d8df0 27793 and follow ups: add PATH_SCRIPT option to find script using $PATH 2010-03-16 09:43:51 +00:00
Peter Stephenson
43df0a21c0 27785: IFS doesn't have a null in it in POSIX
unposted: note & needs quoting in :s in glob qualifier
2010-03-11 22:38:58 +00:00
Peter Stephenson
9fe0077305 Geoff: 27693: rename underscore to avoid name clash 2010-02-09 13:58:11 +00:00
Peter Stephenson
8ac97f3308 27648, 267650/1, unposted README change:
Turn off repeat and turn on ulimit in emulation modes
2010-02-03 18:34:32 +00:00
Peter Stephenson
06b7029aa8 27638, based on Frank Terbeck, 27633: SOURCETRACE option 2010-01-27 19:24:22 +00:00
Wayne Davison
693fd5b56e Check the return value of all pipe(), read(), and write() calls.
Gets rid of all the remaining "ignoring return value" compiler
warnings, and makes some read/write operations safer by ensuring
that an EINTR is handled.
2009-12-16 18:39:06 +00:00
Peter Stephenson
3206b8a2ea 27442 plus tweak: wait returns status for $! even if exited 2009-12-02 09:46:12 +00:00
Peter Stephenson
3257f6b8d5 27134: Close SHTTY on exec.
27135: POSIX_JOBS leaves MONITOR on in subshell and doesn't save
parent job table.
2009-07-12 15:09:56 +00:00
Peter Stephenson
bdfebe3e32 27129: fix status at start of function, command subst, etc. 2009-07-11 16:42:53 +00:00
Peter Stephenson
4db28c55b6 27126: a few more contexts where executing empty lists gives status zero 2009-07-10 22:10:25 +00:00
Peter Stephenson
aa563b1a3f 27110: Only turn on MONITOR if set explicitly or INTERACTIVE 2009-07-09 19:42:20 +00:00
Peter Stephenson
b31ca21b46 27100: Allow MONITOR option in non-interactive shells for testing. 2009-07-08 17:06:02 +00:00
Peter Stephenson
041057687f 27083: non-zero status on failures to find or execute file in "." 2009-07-01 15:07:25 +00:00
Peter Stephenson
6f3f3c6a01 26072: lexsave()/lexrestore() to fix bug with sourcing from "funny" places 2009-03-09 15:57:57 +00:00
Peter Stephenson
64d011185a 26583: use HOOK_FUNCTIONS more widely 2009-02-19 10:12:37 +00:00