ux: default terminal sets correct theme onload

also, increase size of Tab click target
This commit is contained in:
tomholford 2022-03-03 18:11:37 -06:00
parent 438e6d4df9
commit 87ac253b8d
2 changed files with 5 additions and 4 deletions

View File

@ -13,6 +13,7 @@ import React from 'react';
import { Box, Col } from '@tlon/indigo-react';
import { makeTheme } from './lib/theme';
import { showBlit, csi } from './lib/blit';
import { DEFAULT_SESSION } from './constants';
const termConfig: ITerminalOptions = {
logLevel: 'warn',
@ -146,7 +147,7 @@ export default function Buffer({ name, selected, dark }: BufferProps) {
const session: Session = useTermState(s => s.sessions[name]);
const initSession = useCallback(async (name: string, dark: boolean) => {
console.log('setting up', name);
console.log('setting up', name === DEFAULT_SESSION ? 'default' : name);
// set up xterm terminal
//
@ -234,7 +235,7 @@ export default function Buffer({ name, selected, dark }: BufferProps) {
if (container.current) {
container.current.style.backgroundColor = theme.background || '';
}
}, [dark]);
}, [session, dark]);
useEffect(() => {
if (session && selected && !session.term.isOpen) {

View File

@ -44,8 +44,8 @@ export const Tab = ( { session, name }: TabProps ) => {
}, [session]);
return (
<div className={'tab ' + (isSelected ? 'selected' : '')}>
<a className='session-name' onClick={onClick}>
<div className={'tab ' + (isSelected ? 'selected' : '')} onClick={onClick}>
<a className='session-name'>
{session?.hasBell ? '🔔 ' : ''}
{name === DEFAULT_SESSION ? 'default' : name}
{' '}