Files
openidea/src/platform/consoleFont.ts
T
arookieofcanda-rookie-of-C-language 51793e02c5 fix(debugger): use the same console font as the Run window (#2865)
The debug console used the UI mono font and size instead of the console font the Run window resolves from Tools › Terminal › Font (or Editor › Font). Both consoles now take family, size and row height from a shared useConsoleFont() hook, the debug console re-measures its rows when the size changes, and its evaluate input uses the same font.

Closes #2844

Co-authored-by: a-rookie-of-C-language <186315048+a-rookie-of-C-language@users.noreply.github.com>
2026-11-12 18:57:51 +08:00

15 lines
679 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { useProject } from "./project";
import { resolveMonoFont } from "./fonts";
import { useWorkflowSettings } from "./workflowSettings";
/**
* The font of the Run and Debug consoles: Tools › Terminal › Font (which can follow
* Editor › Font), with the row height both consoles lay their lines out with.
*/
export function useConsoleFont(): { family: string; size: number; rowHeight: number } {
const terminalFont = useWorkflowSettings((s) => s.terminal);
const editorFont = useProject((s) => s.settings?.editor);
const { family, size } = resolveMonoFont(terminalFont, editorFont);
return { family, size, rowHeight: Math.max(16, Math.round(size * 1.5)) };
}