fix: support empty string literals in textfx #63

Merged
Passthem merged 3 commits from pi-agent/konabot:fix/textfx-empty-string into master 2026-03-18 19:41:35 +08:00
3 changed files with 24 additions and 7 deletions
Showing only changes of commit 5b1c6d446c - Show all commits

View File

@ -189,7 +189,7 @@ class PipelineRunner:
i += 1
continue
if c.isspace() or c in " ":
if c.isspace():
flush_word()
i += 1
continue

View File

@ -14,8 +14,7 @@ class THEcho(TextHandler):
self, env: TextHandlerEnvironment, istream: str | None, args: list[str]
) -> TextHandleResult:
# echo 不读 stdin只输出参数Unix 语义)
if len(args) == 0:
return TextHandleResult(1, "请在 echo 后面添加需要输出的文本")
# 无参数时输出空行(与 Unix echo 行为一致)
return TextHandleResult(0, "\n".join(args))