diff --git a/examples/ssh-same-path.scm b/examples/ssh-same-path.scm index 79f5682..458ee88 100755 --- a/examples/ssh-same-path.scm +++ b/examples/ssh-same-path.scm @@ -32,11 +32,13 @@ exec scsh -lel expect/load.scm -o threads -o tty-utils -o expect -o let-opt -e m (chat-monitor (lambda (ev msg) (cond ((eq? ev 'abort) - (write-string (task:pre-match task) user-out) - (write-string msg user-out) + (if (task:pre-match task) + (write-string (task:pre-match task) user-out)) + (write-string (match:substring msg) user-out) (write-string (task:buf task) user-out)) ((eq? ev 'timeout) - (write-string (task:pre-match task) user-out) + (if (task:pre-match task) + (write-string (task:pre-match task) user-out)) (write-string (task:buf task) user-out))))) (chat-abort *prompt-regexp*) @@ -54,14 +56,7 @@ exec scsh -lel expect/load.scm -o threads -o tty-utils -o expect -o let-opt -e m (tsend/cr task (string-append "cd " dir)) - ;;(let ((tty-before (tty-info user-in))) - ;; (modify-tty (lambda (ti) (raw (echo-off ti))) user-in) - ;; raw-initialize needed?? - - (interact task) - - ;;(set-tty-info/now user-in tty-before)) - )) + (interact task))) ;; read string without echoing it ;; optionals arguments: