I am noticing this behaviour:
When the os command starts, it starts a reader process on stdin. This channel is added by wm/sh.b into a list of channels reading on the /dev/cons.pid (rdreq: list of file.read channels). The /dev/cons.pid is the stdin of the os reader process.
When the os process dies, it kills the stdin reader process. But, the channel still remains in the wm/sh list of channels reading on the /dev/cons.pid file. I do not see any explicit cleanup by wm/sh of such channels (in the rdreq list of channels). The only cleanup that is happening is when we send something into that channel and the send fails.
This is the reason for the need to press Enter twice so that send to the first channel fails and the data is sent to the newer or later file.read channel.
The wm/sh's sendinput function can use a loop to send to the next channel in the list of channels reading on the file.read of /dev/cons.pid when the send to a channel fails.
But, I cannot figure out why others do not notice this behaviour. And, that makes me suspect that I might have messed up something in the dis.64 port.