feat: Add markdown toggle (alt+m) to switch between rendered and raw… (#10383)

Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
Srivats Jayaram
2025-10-16 11:23:36 -07:00
committed by GitHub
parent 05930d5e25
commit 6ded45e5d2
19 changed files with 245 additions and 7 deletions

View File

@@ -793,6 +793,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
const [showErrorDetails, setShowErrorDetails] = useState<boolean>(false);
const [showToolDescriptions, setShowToolDescriptions] =
useState<boolean>(false);
const [renderMarkdown, setRenderMarkdown] = useState<boolean>(true);
const [ctrlCPressedOnce, setCtrlCPressedOnce] = useState(false);
const ctrlCTimerRef = useRef<NodeJS.Timeout | null>(null);
@@ -973,6 +974,13 @@ Logging in with Google... Please restart Gemini CLI to continue.
if (Object.keys(mcpServers || {}).length > 0) {
handleSlashCommand(newValue ? '/mcp desc' : '/mcp nodesc');
}
} else if (keyMatchers[Command.TOGGLE_MARKDOWN](key)) {
setRenderMarkdown((prev) => {
const newValue = !prev;
// Force re-render of static content
refreshStatic();
return newValue;
});
} else if (
keyMatchers[Command.TOGGLE_IDE_CONTEXT_DETAIL](key) &&
config.getIdeMode() &&
@@ -1011,6 +1019,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
activePtyId,
embeddedShellFocused,
settings.merged.general?.debugKeystrokeLogging,
refreshStatic,
],
);
@@ -1139,6 +1148,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
filteredConsoleMessages,
ideContextState,
showToolDescriptions,
renderMarkdown,
ctrlCPressedOnce,
ctrlDPressedOnce,
showEscapePrompt,
@@ -1221,6 +1231,7 @@ Logging in with Google... Please restart Gemini CLI to continue.
filteredConsoleMessages,
ideContextState,
showToolDescriptions,
renderMarkdown,
ctrlCPressedOnce,
ctrlDPressedOnce,
showEscapePrompt,