Index | Thread | Search

From:
"Ted Unangst" <tedu@tedunangst.com>
Subject:
Re: firefox compat for ps
To:
"Ted Unangst" <tedu@tedunangst.com>
Cc:
"Job Snijders" <job@openbsd.org>, tech@openbsd.org
Date:
Mon, 24 Mar 2025 18:00:48 -0400

Download raw body.

Thread
On 2025-03-23, Ted Unangst wrote:
> On 2025-03-23, Job Snijders wrote:
> > Did you consider cranking it up to 7 digits (to better accommodate
> > chubby instances of for example chromium, mount_mfs, and mutt)?
> 
> I think a better fix is to dynamically size some columns, but this
> is a bit more involved giving the way the printing code works. Will
> think about it for a bit.

So I'm not wedded to this idea, but if the terminal is wider, we can
make a few adjustments. You want to see big processes, you need to buy
a bigger monitor.

Index: ps.c
===================================================================
RCS file: /cvs/src/bin/ps/ps.c,v
diff -u -p -r1.81 ps.c
--- ps.c	18 May 2024 13:08:09 -0000	1.81
+++ ps.c	24 Mar 2025 21:57:20 -0000
@@ -412,6 +412,9 @@ scanvars(void)
 
 	for (vent = vhead; vent; vent = vent->next) {
 		v = vent->var;
+		if (termwidth >= 84 && (strcmp(v->name, "rss") == 0 ||
+		    strcmp(v->name, "vsz") == 0))
+			v->width += 2;
 		i = strlen(v->header);
 		if (v->width < i)
 			v->width = i;