-
- )
-}
-
interface FilesystemTabProps extends FileTreeBodyProps {
canCollapse: boolean
cwdName: string
diff --git a/apps/desktop/src/app/right-sidebar/store.ts b/apps/desktop/src/app/right-sidebar/store.ts
index a560bfddafeb..8c07f0824506 100644
--- a/apps/desktop/src/app/right-sidebar/store.ts
+++ b/apps/desktop/src/app/right-sidebar/store.ts
@@ -2,14 +2,10 @@ import { atom } from 'nanostores'
import { persistBoolean, storedBoolean } from '@/lib/storage'
-export type RightSidebarTabId = 'files' | 'git' | 'terminal' | 'web'
-
const TAKEOVER_KEY = 'hermes.desktop.terminalTakeover'
-export const $rightSidebarTab = atom('files')
export const $terminalTakeover = atom(storedBoolean(TAKEOVER_KEY, false))
$terminalTakeover.subscribe(active => persistBoolean(TAKEOVER_KEY, active))
-export const setRightSidebarTab = (tab: RightSidebarTabId) => $rightSidebarTab.set(tab)
export const setTerminalTakeover = (active: boolean) => $terminalTakeover.set(active)
diff --git a/apps/desktop/src/app/right-sidebar/terminal/index.tsx b/apps/desktop/src/app/right-sidebar/terminal/index.tsx
index f11a705300ae..3ece92354ee5 100644
--- a/apps/desktop/src/app/right-sidebar/terminal/index.tsx
+++ b/apps/desktop/src/app/right-sidebar/terminal/index.tsx
@@ -1,17 +1,19 @@
import '@xterm/xterm/css/xterm.css'
import { useStore } from '@nanostores/react'
+import type { CSSProperties } from 'react'
import { Button } from '@/components/ui/button'
import { Codicon } from '@/components/ui/codicon'
import { Loader } from '@/components/ui/loader'
import { Tip } from '@/components/ui/tooltip'
import { useI18n } from '@/i18n'
+import { useTheme } from '@/themes/context'
import { SidebarPanelLabel } from '../../shell/sidebar-label'
-import { $terminalTakeover, setRightSidebarTab, setTerminalTakeover } from '../store'
+import { $terminalTakeover, setTerminalTakeover } from '../store'
-import { addSelectionShortcutLabel } from './selection'
+import { addSelectionShortcutLabel, terminalTheme } from './selection'
import { useTerminalSession } from './use-terminal-session'
interface TerminalTabProps {
@@ -21,6 +23,9 @@ interface TerminalTabProps {
export function TerminalTab({ cwd, onAddSelectionToChat }: TerminalTabProps) {
const { t } = useI18n()
+ const { resolvedMode } = useTheme()
+ const theme = terminalTheme(resolvedMode)
+
const { addSelectionToChat, hostRef, selection, selectionStyle, shellName, status } = useTerminalSession({
cwd,
onAddSelectionToChat
@@ -30,22 +35,17 @@ export function TerminalTab({ cwd, onAddSelectionToChat }: TerminalTabProps) {
const label = takeover ? t.rightSidebar.terminalSplit : t.rightSidebar.terminalFocus
const toggleTakeover = () => {
- // Pre-select the Terminal tab so the slot is ready to host us on return.
- if (takeover) {
- setRightSidebarTab('terminal')
- }
-
setTerminalTakeover(!takeover)
}
return (
- {shellName}
+ {shellName}
-
+
{status === 'starting' && (
)}
- {/* Outer div paints the dark inset; inner div is the xterm host so the
- canvas sizes to the *content* area and p-2 shows as terminal padding.
- Forcing screen/viewport bg avoids xterm's default black peeking
- through the unused pixels below the last full row. */}
+ {/* Outer div paints terminal inset; inner div is the xterm host so the
+ canvas sizes to the content area and p-2 stays as terminal padding. */}