about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/jobs.c15
2 files changed, 12 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 7aaadfeb3..e836a3853 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2024-02-28  Oliver Kiddle  <opk@zsh.org>
 
+	* 52622 (tweaked, c.f. 52626): Src/jobs.c: adjust number of columns
+	and drop right-parenthesis in "kill -L" output
+
 	* 52623: Src/signames2.awk: add some Solaris signal descriptions
 
 2024-02-28  Oliver Kiddle  <opk@zsh.org>
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;
 	    }