diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-11-26 14:57:11 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-11-26 15:01:46 +0100 |
commit | 9a6d506ac8da33d65a44ae4ace61448e93b9a866 (patch) | |
tree | e0aff9252d2cd0fd88da73848964eaa72189a83a /Userland/ps.cpp | |
parent | aa49419173e860db5a4f4d4c9cbb8182fea394e9 (diff) | |
download | serenity-9a6d506ac8da33d65a44ae4ace61448e93b9a866.zip |
ps: Show "/dev/pts/0" as "pts/0" instead of "0"
Also tweak the alignment of the output a bit.
Diffstat (limited to 'Userland/ps.cpp')
-rw-r--r-- | Userland/ps.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/ps.cpp b/Userland/ps.cpp index d140b729e0..a56da0c12d 100644 --- a/Userland/ps.cpp +++ b/Userland/ps.cpp @@ -9,7 +9,7 @@ int main(int argc, char** argv) (void)argc; (void)argv; - printf("PID TPG PGP SID OWNER STATE PPID NSCHED FDS TTY NAME\n"); + printf("PID TPG PGP SID UID STATE PPID NSCHED FDS TTY NAME\n"); auto all_processes = CProcessStatisticsReader::get_all(); @@ -17,12 +17,12 @@ int main(int argc, char** argv) const auto& proc = it.value; auto tty = proc.tty; - if (tty != "notty") - tty = strrchr(tty.characters(), '/') + 1; + if (tty.starts_with("/dev/")) + tty = tty.characters() + 5; else tty = "n/a"; - printf("%-3u %-3u %-3u %-3u %-4u %-10s %-3u %-9u %-4u %-4s %s\n", + printf("%-3u %-3u %-3u %-3u %-3u %-11s %-3u %-9u %-3u %-5s %s\n", proc.pid, proc.pgid, proc.pgp, |