Make it so that drivenengine never changes (only appends) output bytes.

This commit is contained in:
2022-01-06 17:24:32 -05:00
parent 3306281dcc
commit dc2237e5c1
4 changed files with 59 additions and 42 deletions

View File

@@ -164,13 +164,22 @@ private:
void feed_readline(int nbytes, const char *bytes);
void peek_outgoing(int *nbytes, const char **bytes);
void sent_outgoing(int nbytes);
void show_or_hide_command(bool ignore_sb_out);
void erase_command();
void echo_command();
private:
static const int READLINE_MAX=512;
int chid_;
std::unique_ptr<StreamBuffer> sb_in_;
std::unique_ptr<StreamBuffer> sb_out_;
// These are the in/out buffers presented to the user.
std::shared_ptr<StreamBuffer> sb_in_;
std::shared_ptr<StreamBuffer> sb_out_;
// In readline mode, we inject tty echoes into the output stream.
// This buffer holds the users output interleaved with the tty echoes.
// In non-readline mode, this is just another pointer to sb_out.
std::shared_ptr<StreamBuffer> sb_drvout_;
int port_;
bool closed_;
std::string error_;
@@ -182,7 +191,6 @@ private:
std::string current_command_;
std::string desired_prompt_;
std::string current_prompt_;
std::string readline_echo_;
char readline_lastc_;
bool readline_enabled_;