I am trying to implement a basic shell.
I need to read user input until some delimiters are pressed so a correspondi
The answers to the immediate questions on whether and how std::istream is buffered are: yes, std::istream is buffer using a class derived from std::streambuf which defines the actual buffering and reading approach for a concrete source (or, when using an std::ostream for a destination). Whether this really does any buffering depends on this concrete class and its operation can generally not avoided.
That said , this isn't you problem! The problem is that normally input isn't sent to standard input if a program until the newline key is hit. This is so that some line editing can be done by the terminal implementation and doesn't have to be done by every program. Unfortunately, there is no portable approach to change this. On POSIX youcan turn the standard input stream (using file descriptor 0) into non-canonical mode using tcgetattr() and tcsetattr(). I don't know how to achieve this on non-POSIX systems.