Thank you for your replay.
But I do not understand it, rust was able to write into shell and got last shell replay.
I do also understand that the first message from shell "Enter something: " was not ended and shell kept running waiting for any input. If I remember correctly in Go they suggested to run shell in a thread and communicate via 2 pipes: parent receives messages from child and child from parent, then child finish. I need to search something similar here.
The shell's read command in particular is deciding not to print its prompt text. You got all the output the shell actually produced.
If you want the shell to print its prompts you will have to attach a pseudo-terminal (pty) to the child process instead of pipes. Rust's std doesn't support this, but maybe nix could help.
Thank you for your replay
I have also found some info about "-p message".
-p prompt
Display prompt on standard error, without a trailing new‐
line, before attempting to read any input. The prompt is
displayed only if input is coming from a terminal.
My advice - avoid it.
I found different approach, so my issue was solved.