1
0
mirror of https://github.com/NevermindZZT/letter-shell.git synced 2025-01-21 10:02:54 +08:00

修复 passthrough模式无输入状态下回车无响应的问题

This commit is contained in:
Letter 2021-06-02 22:27:48 +08:00
parent 6c555d42ea
commit b10ebd11ab

View File

@ -40,15 +40,14 @@ unsigned int shellPassthrough(Shell *shell, const char *prompt, ShellPassthrough
{
if (data == '\r' || data == '\n')
{
if (shell->parser.length == 0)
{
continue;
}
shellWriteString(shell, "\r\n");
shell->parser.buffer[shell->parser.length] = 0;
handler(shell->parser.buffer, shell->parser.length);
shell->parser.length = 0;
shell->parser.cursor = 0;
if (shell->parser.length != 0)
{
shell->parser.buffer[shell->parser.length] = 0;
handler(shell->parser.buffer, shell->parser.length);
shell->parser.length = 0;
shell->parser.cursor = 0;
}
shellWriteString(shell, prompt);
}
else if (data == SHELL_PASSTHROUGH_EXIT_KEY)