From ded258241f7475b8ce8e5dac82b9bb35b33f67a8 Mon Sep 17 00:00:00 2001 From: mainzelm Date: Tue, 11 Oct 2005 15:43:19 +0000 Subject: [PATCH] Fix continue-job-in-fg with a hack part of darcs patch Fri Sep 23 22:16:49 MST 2005 Eric Knauel --- scheme/job.scm | 7 +++++-- scheme/nuit-engine.scm | 8 ++++++++ scheme/nuit-packages.scm | 7 ++++++- scheme/utils.scm | 13 ++++++++++++- 4 files changed, 31 insertions(+), 4 deletions(-) diff --git a/scheme/job.scm b/scheme/job.scm index 67e75df..6fb8578 100644 --- a/scheme/job.scm +++ b/scheme/job.scm @@ -114,9 +114,11 @@ (begin (drain-tty (current-output-port)) (def-prog-mode) + (clear) + (refresh) (endwin) - (newline) - (drain-tty (current-output-port)) +; (newline) +; (drain-tty (current-output-port)) (obtain-lock paint-lock) (set-tty-process-group (current-output-port) (proc:pid (job-proc job))) @@ -125,6 +127,7 @@ (set-tty-process-group (current-output-port) (pid)) (display "Press any key to return to Commander S...") (wait-for-key) + (set-redisplay-everything) (release-lock paint-lock)))) (define (continue-job-in-background job) diff --git a/scheme/nuit-engine.scm b/scheme/nuit-engine.scm index 1f06627..cf3d26c 100644 --- a/scheme/nuit-engine.scm +++ b/scheme/nuit-engine.scm @@ -525,6 +525,14 @@ (send (current-viewer) 'key-press ch c-x-pressed?)) (obtain-lock paint-lock) + + ;;; only necessary when continueing a background job in fg + (if (redisplay-everything?) + (begin + (paint-result-frame-window) + (paint-active-command-window) + (unset-redisplay-everything))) + (paint-result-window (entry-data (current-history-item))) (move-cursor (command-buffer) (result-buffer)) (refresh-result-window) diff --git a/scheme/nuit-packages.scm b/scheme/nuit-packages.scm index 6027a25..bfbb206 100644 --- a/scheme/nuit-packages.scm +++ b/scheme/nuit-packages.scm @@ -12,7 +12,11 @@ (export display-to-string write-to-string on/off-option-processor - paste-selection)) + paste-selection + + set-redisplay-everything + unset-redisplay-everything + redisplay-everything?)) (define-structure utils utils-interface (open scheme @@ -774,6 +778,7 @@ eval-environment initial-tty ncurses + utils terminal-buffer nuit-windows app-windows diff --git a/scheme/utils.scm b/scheme/utils.scm index 4821c41..160dbe3 100644 --- a/scheme/utils.scm +++ b/scheme/utils.scm @@ -23,4 +23,15 @@ "" (if for-scheme-mode? (to-scheme (car vals)) - (to-command (car vals)))))) \ No newline at end of file + (to-command (car vals)))))) + +(define *redisplay-everything* #t) + +(define (set-redisplay-everything) + (set! *redisplay-everything* #t)) + +(define (unset-redisplay-everything) + (set! *redisplay-everything* #f)) + +(define (redisplay-everything?) + *redisplay-everything*)