From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 2683 invoked from network); 22 Nov 2023 23:12:49 -0000 Received: from 9front.inri.net (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 22 Nov 2023 23:12:49 -0000 Received: from mail-ot1-f50.google.com ([209.85.210.50]) by 9front; Wed Nov 22 18:11:44 -0500 2023 Received: by mail-ot1-f50.google.com with SMTP id 46e09a7af769-6ce2988d62eso191277a34.1 for <9front@9front.org>; Wed, 22 Nov 2023 15:11:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1700694701; x=1701299501; darn=9front.org; h=content-transfer-encoding:content-language:to:subject:user-agent :mime-version:date:message-id:from:from:to:cc:subject:date :message-id:reply-to; bh=hYp8Ky0VjvvCMt+b3oj56WsklfR7IbfngwCV0bMFpt0=; b=Prz9Vo5oOUmU9LahURRsNiwqQ+Qx8Qr1zuQQ8W3UTOdQzG2B+nxHfoYL8j4AuTFrBE BABFh/jHRIES1YvyVMXtX0iYdtke/4lc2pABdRPKUnlh0Jqbzeb31hQMlgAswTNqqUc7 71QL0CdHlA0lAKz/8QiDq0DGydS/IEMud1Nu5s4QH3Hf9vvfNNYxjMJfHxSj8VNBFXTC zDMkjEx6K4R/dXklDfGOXstwavfwe25k24ucg5oGJ2jnnY7uMoiGVrxnxS1RM5hIuL9K 99SfTUzaKwP1bPjThBZ+NOjpUHzIYHVf0NqCUbNYuXxKXPewrM2ALK5TCza9EKtutex5 dk/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700694701; x=1701299501; h=content-transfer-encoding:content-language:to:subject:user-agent :mime-version:date:message-id:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hYp8Ky0VjvvCMt+b3oj56WsklfR7IbfngwCV0bMFpt0=; b=DMEhfTaYypi4/UqIU6aP9hJqGhMJTaIKbrsvj1JgNalTmJLiVJAmr1V7sIQ22paHhJ 6DZ4LGqau4+1e+ocJxvMAA2wVZ9SDafFIX3Z+QueyE/gB6lYF1LevDOLoKTu0n5HjjI+ +UXoEAjuINJPgdzuKHfDku2Wct8qJY4pizp1bUHD3qfKUW7igAayX8PQbeGTBKFmWYVh bLCxuwyCNYlGRw8trUSXva2ZnxQf78Pr5XaWhC76H8zU9+zGl0NQCXQ3jjYSmpeIMyuF 6Tbtr6nUe/LQCMdmOOv1Kr4y5IcOF9lrWwCEQF+omlYstOJgjXQF3hsoxZvF+0QtgECh LmWw== X-Gm-Message-State: AOJu0YyfKdbUZC69SPE/6qbxRjN0LRMSmMz4I30U0/PI0pzMyn1yLJm+ vgNd98gv/HcFuDlC5SpZzPwuUuHrrIc4Dg== X-Google-Smtp-Source: AGHT+IE0+L1HATQ8juULGzCdrIpmC2KBU9CgU1P4DQCqvcVp7xnDARYTkqyoGBxPzY1o3Vkp4+0laQ== X-Received: by 2002:a05:6870:7a18:b0:1ea:43aa:3fd9 with SMTP id hf24-20020a0568707a1800b001ea43aa3fd9mr4839002oab.25.1700694701466; Wed, 22 Nov 2023 15:11:41 -0800 (PST) Return-Path: Received: from ?IPV6:2600:1700:e4c0:9ea0::5f6? ([2600:1700:e4c0:9ea0::5f6]) by smtp.gmail.com with ESMTPSA id lu8-20020a056871430800b001d4d8efa7f9sm28965oab.4.2023.11.22.15.11.40 for <9front@9front.org> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 22 Nov 2023 15:11:40 -0800 (PST) From: Blue-Maned_Hawk X-Google-Original-From: Blue-Maned_Hawk Message-ID: <513ec441-5e12-4adc-97b1-0dd4c7606613@invalid.invalid> Date: Wed, 22 Nov 2023 18:11:39 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: 9front@9front.org Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: basic method event wrapper-aware configuration locator Subject: [9front] [PATCH] Make pstree work with proportional fonts Reply-To: 9front@9front.org Precedence: bulk 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"); }  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