Merge tag 'v0.1.15' into feature/yiheng/sync-gemini-cli-0.1.15

This commit is contained in:
奕桁
2025-08-01 23:06:11 +08:00
340 changed files with 36528 additions and 22931 deletions

View File

@@ -12,6 +12,13 @@ import { isNodeError, getProjectTempDir } from '@qwen-code/qwen-code-core';
const HISTORY_FILE = 'shell_history';
const MAX_HISTORY_LENGTH = 100;
export interface UseShellHistoryReturn {
addCommandToHistory: (command: string) => void;
getPreviousCommand: () => string | null;
getNextCommand: () => string | null;
resetHistoryPosition: () => void;
}
async function getHistoryFilePath(projectRoot: string): Promise<string> {
const historyDir = getProjectTempDir(projectRoot);
return path.join(historyDir, HISTORY_FILE);
@@ -42,7 +49,7 @@ async function writeHistoryFile(
}
}
export function useShellHistory(projectRoot: string) {
export function useShellHistory(projectRoot: string): UseShellHistoryReturn {
const [history, setHistory] = useState<string[]>([]);
const [historyIndex, setHistoryIndex] = useState(-1);
const [historyFilePath, setHistoryFilePath] = useState<string | null>(null);