Sort process table by PID

This commit is contained in:
Tony Garnock-Jones 2016-12-07 09:47:03 +13:00
parent 985403894f
commit f440911e7f
1 changed files with 4 additions and 1 deletions

View File

@ -2,6 +2,7 @@
(provide set-stderr-trace-flags!)
(require data/order)
(require racket/set)
(require racket/match)
(require racket/pretty)
@ -234,7 +235,9 @@
['SIGUSR1
(with-color WHITE-ON-GREEN
(output "\e[2J\e[HProcess name table:\n")
(for [((pid name) (in-hash process-names))]
(for [(pid (in-list (sort (hash-keys process-names)
(order-<? datum-order))))]
(define name (hash-ref process-names pid))
(output "\t~v\t--> ~v\n" pid name)))]
['SIGUSR2
(with-color WHITE-ON-BLUE