[WIP] fix stdin closing