Compare commits
2 Commits
v0.3.5-bet
...
v0.3.5-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a218b1904 | ||
|
|
399b845e14 |
@@ -204,7 +204,7 @@ function createTerminal(container, settings = {}) {
|
||||
const term = new XTerm({
|
||||
cursorBlink: true,
|
||||
allowProposedApi: true,
|
||||
fontSize: settings.fontSize || 12,
|
||||
fontSize: settings.fontSize || 6,
|
||||
fontFamily: settings.fontFamily || "'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', 'Menlo', monospace",
|
||||
theme,
|
||||
allowTransparency: false,
|
||||
@@ -350,7 +350,7 @@ export default function Shell({ api }) {
|
||||
const { t } = useI18n()
|
||||
const tabsRef = useRef({})
|
||||
const nextIdRef = useRef(1)
|
||||
const settingsRef = useRef({ fontSize: 12, fontFamily: "'JetBrains Mono', 'Fira Code', monospace", theme: 'system' })
|
||||
const settingsRef = useRef({ fontSize: 6, fontFamily: "'JetBrains Mono', 'Fira Code', monospace", theme: 'system' })
|
||||
const pendingCommandsRef = useRef({})
|
||||
|
||||
const [tabs, setTabs] = useState(() => {
|
||||
@@ -399,7 +399,7 @@ export default function Shell({ api }) {
|
||||
const [editingTab, setEditingTab] = useState(null)
|
||||
const [editName, setEditName] = useState('')
|
||||
const [terminalSettings, setTerminalSettings] = useState({
|
||||
fontSize: 12,
|
||||
fontSize: 6,
|
||||
fontFamily: "'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', 'Menlo', monospace",
|
||||
theme: 'system',
|
||||
})
|
||||
@@ -414,7 +414,7 @@ export default function Shell({ api }) {
|
||||
useEffect(() => { settingsRef.current = terminalSettings }, [terminalSettings])
|
||||
|
||||
useEffect(() => {
|
||||
baseFontSizeRef.current = terminalSettings.fontSize || 12
|
||||
baseFontSizeRef.current = terminalSettings.fontSize || 6
|
||||
}, [terminalSettings.fontSize])
|
||||
|
||||
useEffect(() => {
|
||||
@@ -496,7 +496,7 @@ export default function Shell({ api }) {
|
||||
api.getConfig().then(d => {
|
||||
if (d.terminal) {
|
||||
setTerminalSettings({
|
||||
fontSize: d.terminal.font_size || 12,
|
||||
fontSize: d.terminal.font_size || 6,
|
||||
fontFamily: d.terminal.font_family || "'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'SF Mono', 'Menlo', monospace",
|
||||
theme: d.terminal.theme || 'system',
|
||||
})
|
||||
@@ -511,8 +511,9 @@ export default function Shell({ api }) {
|
||||
if (!container) return
|
||||
|
||||
const s = settingsRef.current
|
||||
const effectiveFontSize = s.fontSize + zoomLevel * 2
|
||||
const { term, fitAddon, searchAddon } = createTerminal(container, {
|
||||
fontSize: s.fontSize,
|
||||
fontSize: effectiveFontSize,
|
||||
fontFamily: s.fontFamily,
|
||||
theme: s.theme,
|
||||
})
|
||||
@@ -706,6 +707,12 @@ export default function Shell({ api }) {
|
||||
})
|
||||
}
|
||||
|
||||
for (const tab of tabs) {
|
||||
if (!tabsRef.current[tab.id]) {
|
||||
tryInitTab(tab, 0)
|
||||
}
|
||||
}
|
||||
|
||||
const wrapper = document.querySelector('.shell-layout')?.parentElement
|
||||
let observer
|
||||
if (wrapper) {
|
||||
|
||||
Reference in New Issue
Block a user