From 11081b1567dd4b5b41907b8733c21239079a94ca Mon Sep 17 00:00:00 2001
From: Classic298 <27028174+Classic298@users.noreply.github.com>
Date: Sat, 24 Oct 2026 23:52:48 +0200
Subject: [PATCH] fix: terminal settings show while no terminal is available
(#32981)
Settings > Interface showed the terminal file display, show files on terminal select and terminal preview settings to users who have no terminal to use, which is the default. They now show once the user can reach a terminal, either one the admin set up or one of their own, the same way the chat input decides whether to offer the terminal picker. In the admin default interface settings they show whenever the instance offers terminals.
Refs #32830
---
.../common/InterfaceSettings.svelte | 166 ++++++++++--------
1 file changed, 90 insertions(+), 76 deletions(-)
diff --git a/src/lib/components/common/InterfaceSettings.svelte b/src/lib/components/common/InterfaceSettings.svelte
index 6718819259..b3c9094668 100644
--- a/src/lib/components/common/InterfaceSettings.svelte
+++ b/src/lib/components/common/InterfaceSettings.svelte
@@ -6,7 +6,7 @@
canUseWebSearch,
isSettingsAdmin
} from '$lib/utils/settings-access';
- import { config, settings, user } from '$lib/stores';
+ import { config, settings, terminalServers, user } from '$lib/stores';
import { onMount, getContext } from 'svelte';
import { toast } from 'svelte-sonner';
import { updateUserInfo } from '$lib/apis/users';
@@ -28,6 +28,18 @@
$: currentSettings = (settingsValue ?? $settings ?? {}) as Record;
$: externalSettings = settingsValue !== null;
$: defaultSettings = ($config?.ui?.default_interface_settings ?? {}) as Record;
+ $: hasDirectToolServerAccess =
+ $user?.role === 'admin' || ($user?.permissions?.features?.direct_tool_servers ?? true);
+ $: hasDirectTerminal =
+ ($terminalServers ?? []).some((server) => !server.id) ||
+ (currentSettings?.terminalServers ?? []).some((server) => server.url);
+ // Defaults apply to every user, so they follow what the instance offers.
+ $: hasTerminal =
+ $config?.features?.enable_tool_servers &&
+ (($terminalServers ?? []).some((server) => server.id) ||
+ (externalSettings
+ ? $config?.features?.enable_direct_integrations
+ : hasDirectToolServerAccess && hasDirectTerminal));
let backgroundImageUrl: string | null = null;
let inputFiles: FileList | null = null;
@@ -1487,89 +1499,91 @@