@@ -52,8 +52,6 @@ interface TerminalRuntime extends TerminalRendererRuntime {
5252 viewportHandler ?: ( ( ) => void ) | null ;
5353 viewportRestoreRaf ?: number ;
5454 activationRaf ?: number ;
55- rendererAttachRaf ?: number ;
56- webglPostInitTimer ?: number ;
5755 notificationDisposables ?: Array < { dispose : ( ) => void } > ;
5856}
5957
@@ -733,40 +731,26 @@ export function useAppState(
733731
734732 const {
735733 applyTerminalAppearance,
736- clearPendingRendererAttach,
737- ensureWebglRenderer,
738- loadTerminalFonts,
739734 refreshTerminalRows,
740- refreshWebglRenderer,
741735 } = useTerminalRenderer ( ) ;
742736
743737 const applyTerminalAppearanceToRuntime = useCallback (
744- ( runtime : TerminalRuntime , appearance : TerminalAppearance , ensureRenderer = true ) => {
738+ ( runtime : TerminalRuntime , appearance : TerminalAppearance ) => {
745739 if ( ! runtime . term ) {
746740 return ;
747741 }
748742 applyTerminalAppearance ( runtime , appearance ) ;
749- if ( ensureRenderer ) {
750- ensureWebglRenderer ( runtime , appearance ) ;
751- }
752- if ( runtime . webgl ) {
753- refreshWebglRenderer ( runtime ) ;
754- } else {
755- refreshTerminalRows ( runtime . term ) ;
756- }
743+ refreshTerminalRows ( runtime . term ) ;
757744 scheduleTerminalFit ( runtime , true ) ;
758745 } ,
759- [ applyTerminalAppearance , ensureWebglRenderer , refreshTerminalRows , refreshWebglRenderer , scheduleTerminalFit ]
746+ [ applyTerminalAppearance , refreshTerminalRows , scheduleTerminalFit ]
760747 ) ;
761748
762- const applyTerminalAppearanceToAll = useCallback (
763- ( appearance : TerminalAppearance , ensureRenderer = true ) => {
764- forEachTerminalRuntime ( runtimeRef . current , ( runtime ) => {
765- applyTerminalAppearanceToRuntime ( runtime , appearance , ensureRenderer ) ;
766- } ) ;
767- } ,
768- [ applyTerminalAppearanceToRuntime ]
769- ) ;
749+ const applyTerminalAppearanceToAll = useCallback ( ( appearance : TerminalAppearance ) => {
750+ forEachTerminalRuntime ( runtimeRef . current , ( runtime ) => {
751+ applyTerminalAppearanceToRuntime ( runtime , appearance ) ;
752+ } ) ;
753+ } , [ applyTerminalAppearanceToRuntime ] ) ;
770754
771755 const activateRuntime = useCallback (
772756 ( runtime : TerminalRuntime , options ?: { focus ?: boolean ; clearSelection ?: boolean } ) => {
@@ -783,7 +767,7 @@ export function useAppState(
783767 return ;
784768 }
785769 const appearance = toTerminalAppearance ( configRef . current . settings ) ;
786- applyTerminalAppearanceToRuntime ( runtime , appearance , true ) ;
770+ applyTerminalAppearanceToRuntime ( runtime , appearance ) ;
787771 if ( options ?. clearSelection !== false ) {
788772 runtime . term . clearSelection ( ) ;
789773 }
@@ -809,10 +793,6 @@ export function useAppState(
809793 [ activateRuntime , restoreRuntimeViewport , scheduleTerminalFit ]
810794 ) ;
811795
812- const refreshTerminalRenderersAfterFontLoad = useCallback ( ( ) => {
813- applyTerminalAppearanceToAll ( toTerminalAppearance ( configRef . current . settings ) ) ;
814- } , [ applyTerminalAppearanceToAll , toTerminalAppearance ] ) ;
815-
816796 const terminalAppearance = useMemo (
817797 ( ) =>
818798 toTerminalAppearance ( {
@@ -896,24 +876,12 @@ export function useAppState(
896876 applyTerminalAppearanceToAll ( terminalAppearance ) ;
897877 } , [ applyTerminalAppearanceToAll , terminalAppearance ] ) ;
898878
899- useEffect ( ( ) => {
900- let cancelled = false ;
901- loadTerminalFonts ( terminalAppearance ) . then ( ( ) => {
902- if ( cancelled ) {
903- return ;
904- }
905- applyTerminalAppearanceToAll ( terminalAppearance ) ;
906- } ) ;
907- return ( ) => {
908- cancelled = true ;
909- } ;
910- } , [ applyTerminalAppearanceToAll , loadTerminalFonts , terminalAppearance ] ) ;
911-
912879 useEffect ( ( ) => {
913880 const fontSet = document . fonts ;
914881 if ( ! fontSet || typeof fontSet . addEventListener !== "function" ) {
915882 return ;
916883 }
884+
917885 let cancelled = false ;
918886 const scheduleRefresh = ( ) => {
919887 if ( cancelled || fontRefreshRafRef . current !== undefined ) {
@@ -924,13 +892,13 @@ export function useAppState(
924892 if ( cancelled ) {
925893 return ;
926894 }
927- refreshTerminalRenderersAfterFontLoad ( ) ;
895+ applyTerminalAppearanceToAll ( terminalAppearance ) ;
928896 } ) ;
929897 } ;
930- void fontSet . ready . then ( ( ) => {
931- scheduleRefresh ( ) ;
932- } ) ;
898+
899+ void fontSet . ready . then ( scheduleRefresh ) ;
933900 fontSet . addEventListener ( "loadingdone" , scheduleRefresh ) ;
901+
934902 return ( ) => {
935903 cancelled = true ;
936904 fontSet . removeEventListener ( "loadingdone" , scheduleRefresh ) ;
@@ -939,7 +907,7 @@ export function useAppState(
939907 fontRefreshRafRef . current = undefined ;
940908 }
941909 } ;
942- } , [ refreshTerminalRenderersAfterFontLoad ] ) ;
910+ } , [ applyTerminalAppearanceToAll , terminalAppearance ] ) ;
943911
944912 const cycleSession = useCallback ( ( ) => {
945913 const list = sessionsRef . current ;
@@ -1251,13 +1219,13 @@ export function useAppState(
12511219 runtime . term = term ;
12521220 runtime . fit = fit ;
12531221 applyTerminalAppearance ( runtime , terminalAppearance ) ;
1254- ensureWebglRenderer ( runtime , terminalAppearance ) ;
1222+ refreshTerminalRows ( term ) ;
12551223 } ,
12561224 [
12571225 applyTerminalAppearance ,
12581226 attachTerminalHandlers ,
12591227 configureTerminalOptions ,
1260- ensureWebglRenderer ,
1228+ refreshTerminalRows ,
12611229 terminalAppearance ,
12621230 ]
12631231 ) ;
@@ -1282,7 +1250,6 @@ export function useAppState(
12821250
12831251 const cleanupTerminalRuntimeAttachment = useCallback (
12841252 ( runtime : TerminalRuntime ) => {
1285- clearPendingRendererAttach ( runtime ) ;
12861253 if ( runtime . activationRaf !== undefined ) {
12871254 window . cancelAnimationFrame ( runtime . activationRaf ) ;
12881255 runtime . activationRaf = undefined ;
@@ -1309,7 +1276,7 @@ export function useAppState(
13091276 runtime . resizeRaf = undefined ;
13101277 }
13111278 } ,
1312- [ clearPendingRendererAttach ]
1279+ [ ]
13131280 ) ;
13141281
13151282 const detachTerminalRuntime = useCallback (
@@ -1327,12 +1294,7 @@ export function useAppState(
13271294 detachTerminalRuntime ( runtime ) ;
13281295 runtime . notificationDisposables ?. forEach ( ( disposable ) => disposable . dispose ( ) ) ;
13291296 runtime . notificationDisposables = undefined ;
1330- if ( runtime . term ) {
1331- runtime . term . dispose ( ) ;
1332- } else {
1333- runtime . webgl ?. dispose ( ) ;
1334- }
1335- runtime . webgl = undefined ;
1297+ runtime . term ?. dispose ( ) ;
13361298 runtime . term = undefined ;
13371299 runtime . fit = undefined ;
13381300 runtime . ptyId = undefined ;
@@ -1668,8 +1630,6 @@ export function useAppState(
16681630 }
16691631
16701632 const envMap = ensureTermEnv ( envListToMap ( repo . env ) ) ;
1671- const currentSettings = configRef . current . settings ;
1672- await loadTerminalFonts ( toTerminalAppearance ( currentSettings ) ) ;
16731633
16741634 const initCommands : string [ ] = [ ...initialCommands , `cd ${ escapeShellArg ( sessionCwd ) } ` ] ;
16751635 const preCommands = repo . preCommands . trim ( ) ;
@@ -1718,7 +1678,7 @@ export function useAppState(
17181678 } ) ;
17191679 return true ;
17201680 } ,
1721- [ ensureTerminalRuntime , loadTerminalFonts , notify , registerPty , toTerminalAppearance , updateSession ]
1681+ [ ensureTerminalRuntime , notify , registerPty , updateSession ]
17221682 ) ;
17231683
17241684 const restartAgentSession = useCallback (
0 commit comments