I'm not yet able to get an output from chez for a shell command to read the current window title. On racket I could do this:
> (define win (with-output-to-string (lambda() (system "xdotool getwindowfocus getwindowname"))))
and although system returns an output and an exit code 0 win will be the windows name. In Chez the windows name is displayed and win will be ""
So question 1. Is there a way to get the window name with the system command?
--
I have searched for ideas and studied the manual. It seems that open-process-ports is the right command and I get:
> (open-process-ports "xdotool getwindowfocus getwindowname")
#<binary output port pid 8149 stdin>
#<binary input port pid 8149 stdout>
#<binary input port pid 8149 stderr>
8149
So I tried this to read the output and get the error message shown
> (define s (make-string 1000 #\nul))
> (substring s 0 (block-read <binary input port pid 8149 stdout> s 1000))
Exception: variable stdout> is not bound
input-port-ready? shows the same error message so clearly I'm misunderstanding something.
So, question 2. What am I doing wrong and, thus, what would the correct code be?
Thanks