9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [PATCH] Make pstree work with proportional fonts
@ 2023-11-22 23:11 Blue-Maned_Hawk
  2023-11-23  4:27 ` Jacob Moody
  0 siblings, 1 reply; 13+ messages in thread
From: Blue-Maned_Hawk @ 2023-11-22 23:11 UTC (permalink / raw)
  To: 9front

Pstree's current placement of the box-drawing characters after an 
inconsistent proportion of digits and spaces means that they don't align 
when using proportional fonts.  This patch rearranges the output of 
pstree to have the box-drawing characters first.

diff 6b6b9a236d773c704daaf7f7b5b090111e28ac87 uncommitted
--- a/sys/src/cmd/pstree.c
+++ b/sys/src/cmd/pstree.c
@@ -149,7 +149,7 @@
  	last = *--r;
  	*r = last == L' ' ? L'└' : L'├';
  	if(p->pid != 0){
-		Bprint(&bout, "%-11d %S", p->pid, buf);
+		Bprint(&bout, "%S%d: ", buf, p->pid);
  		printargs(p->pid);
  		Bprint(&bout, "\n");
  	}
\x1f
diff f70cf0b70eb2b9b6cdf7208bf775189c724eb446 uncommitted
--- a/sys/man/1/ps
+++ b/sys/man/1/ps
@@ -109,10 +109,12 @@
  to print the arguments for the process.  Newlines in arguments will be 
translated to spaces for display.
  .PP
  .I Pstree
-prints the processes as a tree in a two-column layout where
-the first column being the process id and second column
-the program name and arguments indented and prefixed with
-line drawing runes to reflect the nesting in the hierarchy.
+prints the processes as a tree in a layout where each line
+coresponds to a process and consists of line-drawing
+characters reflecting the nesting of the process in terms of
+the surrounding lines followed by the process ID followed by
+a colon and a space followed by the program name and
+arguments.
  .SH FILES
  .B /proc/*/status
  .SH SOURCE

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-11-25 12:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-22 23:11 [9front] [PATCH] Make pstree work with proportional fonts Blue-Maned_Hawk
2023-11-23  4:27 ` Jacob Moody
2023-11-23  4:39   ` umbraticus
2023-11-23  4:45     ` Jacob Moody
2023-11-23  4:56       ` umbraticus
2023-11-23  5:30         ` ori
2023-11-23  5:51           ` Kurt H Maier
2023-11-23  5:59           ` umbraticus
2023-11-25  0:29             ` Blue-Maned_Hawk
2023-11-25  1:33               ` Jacob Moody
2023-11-25 12:11                 ` Blue-Maned_Hawk
2023-11-25  0:29     ` Blue-Maned_Hawk
2023-11-25  1:40       ` umbraticus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).