Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 25da0c149a | |||
| 457f0d29ae |
@@ -266,9 +266,17 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
|
|||||||
const newSize = Math.max(MIN_FONT_SIZE, Math.min(MAX_FONT_SIZE, fontSize + delta));
|
const newSize = Math.max(MIN_FONT_SIZE, Math.min(MAX_FONT_SIZE, fontSize + delta));
|
||||||
setFontSize(newSize);
|
setFontSize(newSize);
|
||||||
localStorage.setItem(FONT_SIZE_KEY, newSize.toString());
|
localStorage.setItem(FONT_SIZE_KEY, newSize.toString());
|
||||||
if (termRef.current) {
|
if (termRef.current && fitAddonRef.current) {
|
||||||
termRef.current.options.fontSize = newSize;
|
termRef.current.options.fontSize = newSize;
|
||||||
fitAddonRef.current?.fit();
|
requestAnimationFrame(() => {
|
||||||
|
if (termRef.current && fitAddonRef.current) {
|
||||||
|
try {
|
||||||
|
fitAddonRef.current.fit();
|
||||||
|
} catch {
|
||||||
|
// Ignore fit errors during re-initialization
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -345,8 +353,6 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
|
|||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
<div className="terminal-header-right">
|
<div className="terminal-header-right">
|
||||||
{isMobile && (
|
|
||||||
<>
|
|
||||||
<button
|
<button
|
||||||
className="terminal-header-button"
|
className="terminal-header-button"
|
||||||
onClick={() => handleFontSizeChange(-1)}
|
onClick={() => handleFontSizeChange(-1)}
|
||||||
@@ -363,8 +369,6 @@ export const TerminalComponent: React.FC<TerminalProps> = ({
|
|||||||
>
|
>
|
||||||
A+
|
A+
|
||||||
</button>
|
</button>
|
||||||
</>
|
|
||||||
)}
|
|
||||||
{onClose && (
|
{onClose && (
|
||||||
<button className="terminal-close" onClick={onClose} type="button">
|
<button className="terminal-close" onClick={onClose} type="button">
|
||||||
Close
|
Close
|
||||||
|
|||||||
Reference in New Issue
Block a user