expect/unbuffer-child-flush-143963.patch

24 lines
676 B
Diff

diff -up expect-5.43/example/unbuffer.unbuffer expect-5.43/example/unbuffer
--- expect-5.43/example/unbuffer.unbuffer 2004-01-25 02:37:49.000000000 +0100
+++ expect-5.43/example/unbuffer 2008-09-25 12:27:48.000000000 +0200
@@ -6,10 +6,17 @@ if {[string compare [lindex $argv 0] "-p
# pipeline
set stty_init "-echo"
eval spawn -noecho [lrange $argv 1 end]
- interact
+ close_on_eof -i $user_spawn_id 0
+ interact {
+ eof {
+ # flush remaining output from child
+ expect -timeout 1 -re .+
+ return
+ }
+ }
} else {
set stty_init "-opost"
- eval spawn -noecho $argv
set timeout -1
+ eval spawn -noecho $argv
expect
}