Assignments after the first were not recognised as such as without
the full parser the state didn't return to command position.
Fix this in bufferwords() and the completion miniparser.
Pick number of leading or trailing path components to substitute.
Active in history, brace parameters, glob qualifiers.
Add tests for all three environments.
Seen with magic-space.
If there's a parse error in command subtitution we need to complete
reading history to ensure the command line buffer is finished.
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.
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.
Mostly for the case of an interrupt.
Don't try to process words when we know something's gone wrong.
Also abort history reading earlier on an interrupt.
In general we need to wind back over the history text input
inside command substitution because there's no level of
the input mechanism between history and the lexer.
Time doubles on each lock failure.
zsleep() provides microsecond resolution for sleep; uses nanosleep() if
available, else select via means of existing tty poll function.
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.
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.