mirror of
https://github.com/NevermindZZT/letter-shell.git
synced 2025-01-21 10:02:54 +08:00
修复 passthrough模式无输入状态下回车无响应的问题
This commit is contained in:
parent
6c555d42ea
commit
b10ebd11ab
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user