shell end of line parsing
Posted: Fri Apr 03, 2020 3:04 pm
The shell code allows definition of the newline string for output -- SHELL_NEWLINE_STR -- but not on input. The command parser is hardwired to look for '\r' which is an assumption about windows
if (c == '\r') {
chprintf(chp, SHELL_NEWLINE_STR);
#if SHELL_USE_HISTORY == TRUE
save_history(shp, line, p - line);
#endif
*p = 0;
return false;
}
It seems this would be a good place for another "define". I've been bitten by this a few times when working in environments other than windows -- particularly when using programs to communicate with the shell.
if (c == '\r') {
chprintf(chp, SHELL_NEWLINE_STR);
#if SHELL_USE_HISTORY == TRUE
save_history(shp, line, p - line);
#endif
*p = 0;
return false;
}
It seems this would be a good place for another "define". I've been bitten by this a few times when working in environments other than windows -- particularly when using programs to communicate with the shell.