mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:57:45 +00:00
ps: Show "/dev/pts/0" as "pts/0" instead of "0"
Also tweak the alignment of the output a bit.
This commit is contained in:
parent
aa49419173
commit
9a6d506ac8
1 changed files with 4 additions and 4 deletions
|
@ -9,7 +9,7 @@ int main(int argc, char** argv)
|
||||||
(void)argc;
|
(void)argc;
|
||||||
(void)argv;
|
(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();
|
auto all_processes = CProcessStatisticsReader::get_all();
|
||||||
|
|
||||||
|
@ -17,12 +17,12 @@ int main(int argc, char** argv)
|
||||||
const auto& proc = it.value;
|
const auto& proc = it.value;
|
||||||
auto tty = proc.tty;
|
auto tty = proc.tty;
|
||||||
|
|
||||||
if (tty != "notty")
|
if (tty.starts_with("/dev/"))
|
||||||
tty = strrchr(tty.characters(), '/') + 1;
|
tty = tty.characters() + 5;
|
||||||
else
|
else
|
||||||
tty = "n/a";
|
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.pid,
|
||||||
proc.pgid,
|
proc.pgid,
|
||||||
proc.pgp,
|
proc.pgp,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue