Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: real-time signals support



Bart Schaefer wrote:
> I was thinking in terms of populating a hash-format of $signals given
> that the array-format default is probably not going away.  With the
> paren after the numbers I ended up with:
>
>  typeset -A sigs=( ${=${ printf "%d %s\n" ${=${ printf "(%s %s\n"
> ${=${ kill -L }} }} }} )

I'll grant you that isn't trivial even if there may be shorter
approaches.

> The main reason is for terminals narrower than 80-ish columns; wider ones, meh.

How about limiting it to a maximum of six columns like so?

		const int cols = zterm_columns >= 30 ?
		    (zterm_columns < 90 ? zterm_columns / 15 : 6) : 1;

Without the isatty(1) test it can still be piped in column form or you
can use COLUMNS=1 to force single-column output. Or the `isatty(1) &&`
can be added back in?

> > A greater range of values appear to be open to shell functions but
> > otherwise, that sounds about right. There's also negative values.
>
> There would never be a useful negative exit status, would there?

Except for functions (and maybe builtins). Don't think I've ever used
that.

From an external programme, it seems any value is received modulo 256.

> Negative signals translate into the absolute value sent to the process
> group leader, right?

Isn't that negative pids? Or do either have that effect?

Oliver




Messages sorted by: Reverse Date, Date, Thread, Author