diff options
| author | HugoMurillo <[email protected]> | 2025-08-14 17:24:57 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-08-14 23:24:57 +0000 |
| commit | 8c0c8d77706ba3ebea36d42c38f903aa6dd1bf7b (patch) | |
| tree | e8ab52956e3208735e42d79b59d1d2d6d5c48497 /packages/cli/src | |
| parent | 1a41ba7daf369a45fd350dbd630142f0cac70f92 (diff) | |
fix(#5340): unable to load chats with weird characters (#5969)
Diffstat (limited to 'packages/cli/src')
| -rw-r--r-- | packages/cli/src/ui/commands/chatCommand.ts | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/packages/cli/src/ui/commands/chatCommand.ts b/packages/cli/src/ui/commands/chatCommand.ts index 14714df3..1c9029a9 100644 --- a/packages/cli/src/ui/commands/chatCommand.ts +++ b/packages/cli/src/ui/commands/chatCommand.ts @@ -15,6 +15,7 @@ import { CommandKind, SlashCommandActionReturn, } from './types.js'; +import { decodeTagName } from '@google/gemini-cli-core'; import path from 'path'; import { HistoryItemWithoutId, MessageType } from '../types.js'; @@ -41,8 +42,9 @@ const getSavedChatTags = async ( if (file.startsWith(file_head) && file.endsWith(file_tail)) { const filePath = path.join(geminiDir, file); const stats = await fsPromises.stat(filePath); + const tagName = file.slice(file_head.length, -file_tail.length); chatDetails.push({ - name: file.slice(file_head.length, -file_tail.length), + name: decodeTagName(tagName), mtime: stats.mtime, }); } @@ -147,7 +149,7 @@ const saveCommand: SlashCommand = { return { type: 'message', messageType: 'info', - content: `Conversation checkpoint saved with tag: ${tag}.`, + content: `Conversation checkpoint saved with tag: ${decodeTagName(tag)}.`, }; } else { return { @@ -183,7 +185,7 @@ const resumeCommand: SlashCommand = { return { type: 'message', messageType: 'info', - content: `No saved checkpoint found with tag: ${tag}.`, + content: `No saved checkpoint found with tag: ${decodeTagName(tag)}.`, }; } @@ -252,13 +254,13 @@ const deleteCommand: SlashCommand = { return { type: 'message', messageType: 'info', - content: `Conversation checkpoint '${tag}' has been deleted.`, + content: `Conversation checkpoint '${decodeTagName(tag)}' has been deleted.`, }; } else { return { type: 'message', messageType: 'error', - content: `Error: No checkpoint found with tag '${tag}'.`, + content: `Error: No checkpoint found with tag '${decodeTagName(tag)}'.`, }; } }, |
