Skip to content

Commit 2a5504d

Browse files
committed
フォントの読み込みエラーは無視
1 parent e8f4efb commit 2a5504d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/terminal/terminal.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,13 @@ export function useTerminal(props: TerminalProps): TerminalContext {
148148
globals.cssでフォントを指定し読み込んでいるが、
149149
それが読み込まれる前にterminalを初期化してしまうとバグるので、
150150
ここで fonts.load() をawaitしている。
151+
152+
拡張機能などでフォントをブロックしている場合のエラーはcatchしてとにかく続行する
151153
*/
152154
Promise.all([
153155
import("@xterm/xterm"),
154156
import("@xterm/addon-fit"),
155-
document.fonts.load("1rem Inconsolata Variable"),
157+
document.fonts.load("1rem Inconsolata Variable").catch(() => undefined),
156158
]).then(([{ Terminal }, { FitAddon }]) => {
157159
if (!abortController.signal.aborted) {
158160
const term = new Terminal({

0 commit comments

Comments
 (0)