1
0
mirror of https://github.com/PDP-10/its.git synced 2026-03-30 19:24:40 +00:00

WIP: Avoid Expect clobbering stdout when stdin isn't a tty.

Doing expect_after before a child process has been spawned causes Expect
to try reading from stdin. If stdin is /dev/null, it gets an EOF from
the read, assumes it's been closed... and closes stdout too, so we don't
see any more of the child process interaction.

WIP because I've only done this for simh.
This commit is contained in:
Adam Sampson
2018-08-04 01:25:35 +01:00
parent 559771ec58
commit e18ad0db11
2 changed files with 8 additions and 1 deletions

View File

@@ -106,7 +106,11 @@ proc build_macsyma_portion {} {
}
set timeout 100
expect_after timeout abort
proc setup_timeout {} {
# Don't do this until after you've called "spawn", otherwise it'll cause a
# read from stdin which will return EOF if stdin isn't a tty.
expect_after timeout abort
}
set ip [ip_address [lindex $argv 0]]
set gw [ip_address [lindex $argv 1]]

View File

@@ -4,6 +4,8 @@ set emulator_escape "\034"
proc start_salv {} {
uplevel #0 {spawn pdp10 build/simh/init}
setup_timeout
respond "sim>" "show ver\r"
respond "sim>" "b tu1\r"
expect "MTBOOT"
@@ -23,6 +25,7 @@ proc start_dskdmp {} {
proc start_its {} {
uplevel #0 {spawn pdp10 build/simh/boot}
setup_timeout
}
proc mount_tape {file} {