Expect Script - Fixing weird terminal resizing behaviour
When you call spawn inside a procedure the array variable spawn_out(slave,name)
has the scope of that procedure only. Usually, you can just make this into a global scope by declaring it as such inside each procedure:
proc s1 {...} { global spawn_out ... spawn ...}send_user $spawn_out(slave,name)