Skip to content

Commit 4ed4cd4

Browse files
committed
テーマオプション設定
1 parent 8e369f9 commit 4ed4cd4

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

app/terminal/terminal.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@ export function TerminalComponent(props: TerminalComponentProps) {
4040
const term = new Terminal({
4141
cursorBlink: true,
4242
convertEol: true,
43+
cursorStyle: "bar",
44+
cursorInactiveStyle: "none",
45+
theme: {
46+
// DaisyUIの変数を使用してテーマを設定している
47+
// TODO: ダークテーマ/ライトテーマを切り替えたときに再設定する?
48+
// TODO: red, green, blueなどの色も設定する
49+
background: window.getComputedStyle(document.body).getPropertyValue("--color-base-300"),
50+
foreground: window.getComputedStyle(document.body).getPropertyValue("--color-base-content"),
51+
cursor: window.getComputedStyle(document.body).getPropertyValue("--color-base-content"),
52+
selectionBackground: window.getComputedStyle(document.body).getPropertyValue("--color-primary"),
53+
selectionForeground: window.getComputedStyle(document.body).getPropertyValue("--color-primary-content"),
54+
},
4355
});
4456
terminalInstanceRef.current = term;
4557
initDone.current = false;

0 commit comments

Comments
 (0)