Files
claude-code/src/main/java/com/claudecode/command/impl/ClearCommand.java
T
liuzhandCopilot eeceaaaea9 fix: 将所有emoji/Unicode特殊字符替换为ASCII安全字符
Windows cmd/PowerShell默认codepage下emoji显示为?号。
全局替换: 👋->移除, 💭->[Thinking], ⚙->*, ✓->[OK], ✗->[FAIL],
◆->>, ⚠->[!], ->[OK], •->|/-, →->>>, ✏️->[Edit]等。
❯保留(windows-vtp终端下正常显示)。

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-01 20:37:55 +08:00

30 lines
702 B
Java

package com.claudecode.command.impl;
import com.claudecode.command.CommandContext;
import com.claudecode.command.SlashCommand;
import com.claudecode.console.AnsiStyle;
/**
* /clear 命令 —— 清除对话历史。
*/
public class ClearCommand implements SlashCommand {
@Override
public String name() {
return "clear";
}
@Override
public String description() {
return "Clear conversation history";
}
@Override
public String execute(String args, CommandContext context) {
if (context.agentLoop() != null) {
context.agentLoop().reset();
}
return AnsiStyle.green(" [OK] Conversation history cleared.");
}
}