diff options
author | Oliver Kiddle <opk@zsh.org> | 2024-02-28 13:59:10 +0100 |
---|---|---|
committer | Oliver Kiddle <opk@zsh.org> | 2024-02-28 13:59:10 +0100 |
commit | 69c58874611a586c68be14ce7965029dc00f41b7 (patch) | |
tree | d56b7d3e64ce6623dff85e784826e501a213a22a /Src | |
parent | 3078e07729930bfbff647b9b63452b58a54ecc70 (diff) | |
download | zsh-69c58874611a586c68be14ce7965029dc00f41b7.tar.gz zsh-69c58874611a586c68be14ce7965029dc00f41b7.tar.xz zsh-69c58874611a586c68be14ce7965029dc00f41b7.zip |
52622 (tweaked, c.f. 52626): adjust number of columns and drop right-parenthesis in "kill -L" output
Diffstat (limited to 'Src')
-rw-r--r-- | Src/jobs.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Src/jobs.c b/Src/jobs.c index 49decc661..07facc60b 100644 --- a/Src/jobs.c +++ b/Src/jobs.c @@ -2822,23 +2822,26 @@ bin_kill(char *nam, char **argv, UNUSED(Options ops), UNUSED(int func)) #else const int width = SIGCOUNT >= 100 ? 3 : 2; #endif + const int cols = zterm_columns >= 30 ? + (zterm_columns < 90 ? zterm_columns / 15 : 6) : 1; + for (sig = 1; sig < SIGCOUNT #if defined(SIGRTMIN) && defined(SIGRTMAX) + 1 #endif ; sig++) { - printf("%*d) %-10s%c", width, sig, sigs[sig], - sig % 5 ? ' ' : '\n'); + printf("%*d %-10s%c", width, sig, sigs[sig], + sig % cols ? ' ' : '\n'); } #if defined(SIGRTMIN) && defined(SIGRTMAX) for (sig = SIGRTMIN; sig < SIGRTMAX; sig++) { - printf("%*d) %-10s%c", width, sig, rtsigname(sig, 0), - (sig - SIGRTMIN + SIGCOUNT + 1) % 5 ? ' ' : '\n'); + printf("%*d %-10s%c", width, sig, rtsigname(sig, 0), + (sig - SIGRTMIN + SIGCOUNT + 1) % cols ? ' ' : '\n'); } - printf("%*d) RTMAX\n", width, sig); + printf("%*d RTMAX\n", width, sig); #else - printf("%*d) %s\n", width, sig, sigs[sig]); + printf("%*d %s\n", width, sig, sigs[sig]); #endif return 0; } |