Skip to content

Commit 13eb415

Browse files
committed
feat: add fontSizeAdjust property to Terminal component
1 parent 54cd73d commit 13eb415

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: plugins/plugin-codeflare/src/components/Terminal.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ type ClassName = {
5252
export type TerminalOptions = ClassName & {
5353
/** Show search ui? [default: true] */
5454
searchable?: boolean
55+
56+
/** Font size scaling factor from the stock font size from Kui [default: 1] */
57+
fontSizeAdjust?: number
5558
}
5659

5760
type Props = TerminalOptions & {
@@ -262,7 +265,7 @@ export default class XTerm extends React.PureComponent<Props, State> {
262265
const standIn = document.querySelector("body .repl")
263266
if (standIn) {
264267
const fontTheme = getComputedStyle(standIn)
265-
xterm.options.fontSize = parseInt(fontTheme.fontSize.replace(/px$/, ""), 10)
268+
xterm.options.fontSize = parseInt(fontTheme.fontSize.replace(/px$/, ""), 10) * (this.props.fontSizeAdjust || 1)
266269
// terminal.setOption('lineHeight', )//parseInt(fontTheme.lineHeight.replace(/px$/, ''), 10))
267270

268271
// FIXME. not tied to theme

0 commit comments

Comments
 (0)