diff --git a/src/composables/bottomPanelTabs/useTerminal.ts b/src/composables/bottomPanelTabs/useTerminal.ts index d353294f0..ed7fb3fa8 100644 --- a/src/composables/bottomPanelTabs/useTerminal.ts +++ b/src/composables/bottomPanelTabs/useTerminal.ts @@ -5,12 +5,14 @@ import { debounce } from 'es-toolkit/compat' import type { Ref } from 'vue' import { markRaw, onMounted, onUnmounted } from 'vue' +import { isDesktop } from '@/platform/distribution/types' + export function useTerminal(element: Ref) { const fitAddon = new FitAddon() const terminal = markRaw( new Terminal({ convertEol: true, - theme: { background: '#171717' } + theme: isDesktop ? { background: '#171717' } : undefined }) ) terminal.loadAddon(fitAddon) diff --git a/src/platform/distribution/types.ts b/src/platform/distribution/types.ts index 8da710973..2ddeb1343 100644 --- a/src/platform/distribution/types.ts +++ b/src/platform/distribution/types.ts @@ -1,3 +1,5 @@ +import { isElectron } from '@/utils/envUtil' + /** * Distribution types and compile-time constants for managing * multi-distribution builds (Desktop, Localhost, Cloud) @@ -13,6 +15,6 @@ declare global { const DISTRIBUTION: Distribution = __DISTRIBUTION__ /** Distribution type checks */ -// const isDesktop = DISTRIBUTION === 'desktop' -// const isLocalhost = DISTRIBUTION === 'localhost' +export const isDesktop = DISTRIBUTION === 'desktop' || isElectron() // TODO: replace with build var export const isCloud = DISTRIBUTION === 'cloud' +// export const isLocalhost = !isDesktop && !isCloud diff --git a/vitest.setup.ts b/vitest.setup.ts index 56b24693e..86e72cf52 100644 --- a/vitest.setup.ts +++ b/vitest.setup.ts @@ -8,6 +8,7 @@ globalThis.__SENTRY_DSN__ = '' globalThis.__ALGOLIA_APP_ID__ = '' globalThis.__ALGOLIA_API_KEY__ = '' globalThis.__USE_PROD_CONFIG__ = false +globalThis.__DISTRIBUTION__ = 'localhost' // Mock Worker for extendable-media-recorder globalThis.Worker = vi.fn().mockImplementation(() => ({