mirror of
https://github.com/NevermindZZT/letter-shell.git
synced 2025-01-21 10:02:54 +08:00
优化 执行shell命令时尾行模式的表现
This commit is contained in:
parent
0719512b67
commit
8392f6c859
@ -206,7 +206,8 @@ void logHexDump(Log *log, void *base, unsigned int length)
|
||||
printLen = 0;
|
||||
}
|
||||
}
|
||||
SHELL_EXPORT_CMD(SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC),
|
||||
SHELL_EXPORT_CMD(
|
||||
SHELL_CMD_PERMISSION(0)|SHELL_CMD_TYPE(SHELL_TYPE_CMD_FUNC)|SHELL_CMD_DISABLE_RETURN,
|
||||
hexdump, logHexDump, hex dump\r\n hexdump [log] [base] [len]);
|
||||
|
||||
#if SHELL_USING_COMPANION == 1
|
||||
|
18
src/shell.c
18
src/shell.c
@ -1695,18 +1695,24 @@ void shellHandler(Shell *shell, char data)
|
||||
#if SHELL_SUPPORT_END_LINE == 1
|
||||
void shellWriteEndLine(Shell *shell, char *buffer, int len)
|
||||
{
|
||||
shellWriteString(shell, shellText[SHELL_TEXT_CLEAR_LINE]);
|
||||
if (!shell->status.isActive)
|
||||
{
|
||||
shellWriteString(shell, shellText[SHELL_TEXT_CLEAR_LINE]);
|
||||
}
|
||||
while (len --)
|
||||
{
|
||||
shell->write(*buffer++);
|
||||
}
|
||||
shellWriteCommandLine(shell, 0);
|
||||
if (shell->parser.length > 0)
|
||||
if (!shell->status.isActive)
|
||||
{
|
||||
shellWriteString(shell, shell->parser.buffer);
|
||||
for (short i = 0; i < shell->parser.length - shell->parser.cursor; i++)
|
||||
shellWriteCommandLine(shell, 0);
|
||||
if (shell->parser.length > 0)
|
||||
{
|
||||
shell->write('\b');
|
||||
shellWriteString(shell, shell->parser.buffer);
|
||||
for (short i = 0; i < shell->parser.length - shell->parser.cursor; i++)
|
||||
{
|
||||
shell->write('\b');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user