- c = cmdline_dev_recv(NULL);
- if (c < 0)
- return -1;
-
- ret = rdline_char_in(&imuboard.rdl, c);
- if (ret == 1) {
- buffer = rdline_get_buffer(&imuboard.rdl);
- history = rdline_get_history_item(&imuboard.rdl, 0);
- if (history) {
- same = !memcmp(buffer, history, strlen(history)) &&
- buffer[strlen(history)] == '\n';
+ while (1) {
+ c = cmdline_dev_recv(NULL);
+ if (c < 0)
+ break;
+
+ ret = rdline_char_in(&imuboard.rdl, c);
+ if (ret == 1) {
+ buffer = rdline_get_buffer(&imuboard.rdl);
+ history = rdline_get_history_item(&imuboard.rdl, 0);
+ if (history) {
+ same = !memcmp(buffer, history, strlen(history)) &&
+ buffer[strlen(history)] == '\n';
+ }
+ else
+ same = 0;
+ if (strlen(buffer) > 1 && !same)
+ rdline_add_history(&imuboard.rdl, buffer);
+
+ if (imuboard.rdl.status != RDLINE_STOPPED)
+ rdline_newline(&imuboard.rdl, imuboard.prompt);