9front - general discussion about 9front
 help / color / mirror / Atom feed
From: Blue-Maned_Hawk <bluemanedhawk@gmail.com>
To: 9front@9front.org
Subject: [9front] [PATCH] Make pstree work with proportional fonts
Date: Wed, 22 Nov 2023 18:11:39 -0500	[thread overview]
Message-ID: <513ec441-5e12-4adc-97b1-0dd4c7606613@invalid.invalid> (raw)

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

             reply	other threads:[~2023-11-22 23:12 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22 23:11 Blue-Maned_Hawk [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=513ec441-5e12-4adc-97b1-0dd4c7606613@invalid.invalid \
    --to=bluemanedhawk@gmail.com \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).