From 44bfb8f1180438e221965fd5f6832ffd0b81e750 Mon Sep 17 00:00:00 2001 From: eknauel Date: Tue, 27 Sep 2005 08:59:34 +0000 Subject: [PATCH] kill and refresh for ps part of darcs patch Sat Sep 17 19:47:08 EEST 2005 Martin Gasbichler --- scheme/nuit-packages.scm | 2 +- scheme/process.scm | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/scheme/nuit-packages.scm b/scheme/nuit-packages.scm index 67dbc4f..507c456 100644 --- a/scheme/nuit-packages.scm +++ b/scheme/nuit-packages.scm @@ -142,7 +142,7 @@ (define-structure process-viewer (export) - (open scheme + (open scheme-with-scsh define-record-types srfi-1 srfi-13 diff --git a/scheme/process.scm b/scheme/process.scm index 181d318..77a5e65 100644 --- a/scheme/process.scm +++ b/scheme/process.scm @@ -49,6 +49,8 @@ (define-option 'ps 'sort-pid-down-key (char->ascii #\P)) (define-option 'ps 'sort-time-up-key (char->ascii #\t)) (define-option 'ps 'sort-time-down-key (char->ascii #\T)) +(define-option 'ps 'kill-key (char->ascii #\k)) +(define-option 'ps 'refresh-key (char->ascii #\g)) (define (make-pps-viewer processes buffer) (let ((processes processes) @@ -124,7 +126,17 @@ (lambda (p1 p2) (compare (select p1) (select p2))) processes)) - self)) + self)) + ((= key (config 'ps 'kill-key)) + (let ((infos + (select-list-get-selection select-list))) + (for-each + (cut signal-process <> signal/term) + (map process-info-pid infos))) + self) + ((= key (config 'ps 'refresh-key)) + (set-processes! (pps)) + self) (else (set! select-list (select-list-handle-key-press select-list key))