Commit Graph

181 Commits (master)

Author SHA1 Message Date
Oliver Kiddle 5331ff11c6 52594: support for POSIX real-time signals with kill and trap
Also add new -L option to kill for a more verbose listing of signals
3 months ago
Stephane Chazelas f1e7481b86 45837: fix process group restoration upon exit 3 months ago
Bart Schaefer 29644f12e7 52193: handle UTF8-encoded USERNAME and therefore home directory in zcompile
Includes one unposted thinko fix ztrdup -> dupstring
8 months ago
Jun-ichi Takimoto e5f8cc99f5 51639: new parameter ZSH_EXEPATH (full path of zsh executable)
The full pathname is obatined by a reliable method on macOS and systems
that support procfs. But on other systems (FreeBSD, OpenBSD, ...) it is
guessed from argv[0], PWD and PATH.
1 year ago
Jun-ichi Takimoto 8a9aea907a 51631: initialize $_ by copying it from environment 1 year ago
Oliver Kiddle c01479a2ed 51280: add support for italic and faint fonts in the line editor 1 year ago
Oliver Kiddle 667ead3a64 51258, 51272: refactor handling of terminal attributes, removing OFF flags in zattr 1 year ago
Oliver Kiddle a73c705b0c 51212: remove STOUC() macro
This served as a workaround for ancient compilers where casts to
unsigned char were broken.
1 year ago
Oliver Kiddle 271cfc685b 49534, 49539: separate watch/log functionality out into a module 3 years ago
Peter Stephenson e5cd2dd980 49290: Replace stdio for buffered shell input.
The previous method allowed memory management to interact with signal
handlers, causing occasional crashes on some system.

Instead, use a simple pre-allocated buffer and raw system calls.
3 years ago
Peter Stephenson 66ee4918a1 45660: Fix crash setting vi or emacs mode on command line.
Delay setting the option until the module system is set up.
4 years ago
Daniel Shahaf 3511169731 unposted: internal: Add some comments and fix indentation. No functional change. 4 years ago
Daniel Shahaf 8bc4400762 45058: internal: Add symbolic names to possible values of zexit()'s "from_where" parameter. No functional change. 4 years ago
Martijn Dekker c578f0a08b 45004: Fix typos in comments 5 years ago
Oliver Kiddle 3de2333b08 44307: allow for atoi() returning a negative number 5 years ago
Peter Stephenson ca456fbba3 44284: Mark SIGQUIT as ignore if ignored on entry to shell.
This prevents us from re-enabling it after a fork if it is being
ignored.
5 years ago
Oliver Kiddle 37d0005a9e 43747: new module to map colours from hex triplets to the nearest matching colour 6 years ago
Peter Stephenson 0d3a786b7c 43669: ensure explicit exit status is used over implicit 6 years ago
Peter Stephenson bbccbe0c85 43660: extend 43653 when final exit is implicit.
Combine logic for case after committed to exit (shell_exiting) with
case where exit occurred in a function we nee to unwind (exit_pending).

Add sarky note for future generations to be confused at.
6 years ago
Jun-ichi Takimoto baedd62f0d 43219 (except term{cap,info}.c): fix several memory leaks 6 years ago
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.
7 years ago
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.
7 years ago
Barton E. Schaefer fc96274801 40977: "emulate" disallows "--help" and "--version" 7 years ago
Daniel Shahaf 67d882479b 40745 + 40753: Fix 'unset ZLE_RPROMPT_INDENT' not restoring the default behaviour.
To reproduce:

    RPS1=foo
    ZLE_RPROMPT_INDENT=42
    unset ZLE_RPROMPT_INDENT
7 years ago
Peter Stephenson 4ab3fcc90d 39545: Add some missing unqueue_signals().
All of these are added simply to fit existing logic in other branches.
8 years ago
Teubel György fde365ea8b 39167: Make $ENV handling more like POSIX 8 years ago
Greg Klanderman 440c6beec0 38086: shuffle init code to localize a global, add $ZSH_ARGZERO, refine $ZSH_SCRIPT
(also a couple of ChangeLog typos corrected -- Bart)
8 years ago
Peter Stephenson 04479a56e0 unposted: fix init_io() calls in previous change 9 years ago
Peter Stephenson fc00e3a6b7 37294: Add ZSH_EXECUTION_STRING.
This shows the argument to shell option -c.
9 years ago
Mikael Magnusson ae0420c46a 37161: Disable the heuristic setting RPROMPT_INDENT to 0 9 years ago
Barton E. Schaefer 1af2e6e02d 36090: keep signals queued for preprompt() 9 years ago
Barton E. Schaefer 9958684574 36022 fix bug that some loop constructs could not be interrupted, revise signal queueing
There are two underlying ideas here:  (1) Keeping signals queued around
anything that's doing memory management (including push/pop of the heap)
has become crucial.  (2) Anytime the shell is going to run a command, be
it buitin or external, it must be both safe and necessary to process any
queued signals, so that the apparent order of signal arrival and command
execution is preserved.
9 years ago
Barton E. Schaefer a1f8d4ffc7 35826: add getsparam_u() to return unmetafied string, use it for a number of references to non-special params 9 years ago
Barton E. Schaefer 19b37ef565 35482: be consistent about how argzero is allocated 9 years ago
Barton E. Schaefer 89a689e693 34961: replace a couple of free() with zfree() for consistency 9 years ago
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.
9 years ago
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.
9 years ago
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.
9 years ago
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.
10 years ago
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.
10 years ago
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.
10 years ago
Barton E. Schaefer 60e31a45b0 33268: interactive shells treat SIGPIPE like SIGHUP if and only if SHTTY is disconnected 10 years ago
Peter Stephenson 0c7a3d6864 33212: try to put /usr/local/share/zsh/site-functions in default fpath 10 years ago
Barton E. Schaefer 03e53c8f25 33143: POSIX_ARGZERO more closely matches bash et al. 10 years ago
Barton E. Schaefer 19f3161e51 32634: add POSIX_ARGZERO option 10 years ago
Barton E. Schaefer ba58bfe4bf 32365: another stab at the heuristic for initializing rprompt_indent 10 years ago
Barton E. Schaefer 71b235bfa7 32341: heuristic initialization of ZLE_RPROMPT_INDENT 10 years ago
Barton E. Schaefer 3882c30f80 32340: improve error messages for "read -c" / "read -l" 10 years ago
Barton E. Schaefer 9cacf4411f 32157: fix extra line feed after prompt, and erased character in completion listing, when ZLE_RPROMPT_INDENT=0 11 years ago
Barton E. Schaefer bcda34a0b3 32099: change pointer declaration to avoid arithmetic on (void *). 11 years ago