1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-07-05 02:41:26 +02:00
Commit graph

181 commits

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
2024-02-28 00:21:11 +01:00
Stephane Chazelas
f1e7481b86 45837: fix process group restoration upon exit 2024-02-18 18:56:39 +00:00
Bart Schaefer
29644f12e7 52193: handle UTF8-encoded USERNAME and therefore home directory in zcompile
Includes one unposted thinko fix ztrdup -> dupstring
2023-10-01 11:34:33 -07:00
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.
2023-04-11 22:10:33 +09:00
Jun-ichi Takimoto
8a9aea907a 51631: initialize $_ by copying it from environment 2023-04-09 20:44:58 +09:00
Oliver Kiddle
c01479a2ed 51280: add support for italic and faint fonts in the line editor 2023-01-10 20:57:03 +01:00
Oliver Kiddle
667ead3a64 51258, 51272: refactor handling of terminal attributes, removing OFF flags in zattr 2023-01-10 20:53:17 +01:00
Oliver Kiddle
a73c705b0c 51212: remove STOUC() macro
This served as a workaround for ancient compilers where casts to
unsigned char were broken.
2022-12-16 23:28:10 +01:00
Oliver Kiddle
271cfc685b 49534, 49539: separate watch/log functionality out into a module 2021-11-02 21:41:53 +01:00
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.
2021-08-27 09:36:06 +01:00
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.
2020-04-09 21:46:20 +01:00
Daniel Shahaf
3511169731 unposted: internal: Add some comments and fix indentation. No functional change. 2020-01-26 03:46:00 +00:00
Daniel Shahaf
8bc4400762 45058: internal: Add symbolic names to possible values of zexit()'s "from_where" parameter. No functional change. 2019-12-17 05:12:36 +00:00
Martijn Dekker
c578f0a08b 45004: Fix typos in comments 2019-12-11 02:37:39 +00:00
Oliver Kiddle
3de2333b08 44307: allow for atoi() returning a negative number 2019-05-20 00:14:01 +02:00
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.
2019-04-25 20:29:54 +01:00
Oliver Kiddle
37d0005a9e 43747: new module to map colours from hex triplets to the nearest matching colour 2018-11-05 22:24:05 +01:00
Peter Stephenson
0d3a786b7c 43669: ensure explicit exit status is used over implicit 2018-10-10 11:17:58 +01:00
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.
2018-10-09 14:38:26 +01:00
Jun-ichi Takimoto
baedd62f0d 43219 (except term{cap,info}.c): fix several memory leaks 2018-07-31 22:15:58 +09: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
Barton E. Schaefer
fc96274801 40977: "emulate" disallows "--help" and "--version" 2017-04-15 21:16:11 -07:00
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
2017-03-08 10:04:44 +00:00
Peter Stephenson
4ab3fcc90d 39545: Add some missing unqueue_signals().
All of these are added simply to fit existing logic in other branches.
2016-10-03 13:43:20 +01:00
Teubel György
fde365ea8b 39167: Make $ENV handling more like POSIX 2016-09-05 21:03:12 +01:00
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)
2016-03-06 09:53:40 -08:00
Peter Stephenson
04479a56e0 unposted: fix init_io() calls in previous change 2015-12-04 09:42:35 +00:00
Peter Stephenson
fc00e3a6b7 37294: Add ZSH_EXECUTION_STRING.
This shows the argument to shell option -c.
2015-12-04 09:28:26 +00:00
Mikael Magnusson
ae0420c46a 37161: Disable the heuristic setting RPROMPT_INDENT to 0 2015-11-20 14:33:44 +01:00
Barton E. Schaefer
1af2e6e02d 36090: keep signals queued for preprompt() 2015-08-11 08:55:23 -07:00
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.
2015-08-09 16:13:52 -07:00
Barton E. Schaefer
a1f8d4ffc7 35826: add getsparam_u() to return unmetafied string, use it for a number of references to non-special params 2015-07-22 12:52:24 -07:00
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