Skip to content

Commit e9bb6d4

Browse files
authored
refactor(tui): remove terminal pane setting
1 parent 1e69796 commit e9bb6d4

8 files changed

Lines changed: 12 additions & 18 deletions

File tree

‎packages/tui/src/component/dialog-config.tsx‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,6 @@ export const settings: Setting[] = [
5151
values: ["hide", "auto"],
5252
keywords: ["side panel"],
5353
},
54-
{
55-
title: "Terminal",
56-
category: "Session",
57-
path: ["session", "terminal"],
58-
default: process.platform !== "win32",
59-
values: [false, true],
60-
labels: ["off", "on"],
61-
keywords: ["pty", "shell", "terminal pane"],
62-
},
6354
{
6455
title: "Scrollbar",
6556
category: "Session",

‎packages/tui/src/config/index.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ export const Info = Schema.Struct({
148148
sidebar: Schema.optional(Schema.Literals(["auto", "hide"])).annotate({
149149
description: "Session sidebar visibility; 'auto' shows it when space permits",
150150
}),
151-
terminal: Schema.optional(Schema.Boolean).annotate({ description: "Enable persistent session terminal panes" }),
152151
scrollbar: Schema.optional(Schema.Boolean).annotate({ description: "Show the session transcript scrollbar" }),
153152
thinking: Schema.optional(Schema.Literals(["show", "hide"])).annotate({
154153
description: "Show or hide model reasoning by default",
@@ -260,6 +259,7 @@ export type Resolved = Omit<Info, "attention" | "cursor" | "keybinds" | "leader"
260259
session: Omit<NonNullable<Info["session"]>, "new_location" | "permissions" | "tps"> & {
261260
new_location: "launch" | "inherit"
262261
permissions: "prompt" | "autoaccept"
262+
terminal: boolean
263263
tps: boolean
264264
}
265265
tabs: {
@@ -308,7 +308,7 @@ export function resolve(input: Info, options: { terminalSuspend: boolean }): Res
308308
new_location: input.session?.new_location ?? "launch",
309309
permissions: input.session?.permissions ?? "prompt",
310310
// Persistent terminal panes need the opencode-pty daemon, which does not ship Windows binaries.
311-
terminal: input.session?.terminal ?? process.platform !== "win32",
311+
terminal: process.platform !== "win32",
312312
tps: input.session?.tps ?? true,
313313
},
314314
tabs: {

‎packages/tui/test/app-lifecycle.test.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1328,7 +1328,6 @@ test.each(["manual", "select"] as const)(
13281328
get: async () => ({
13291329
animations: false,
13301330
terminal: { copy },
1331-
session: { terminal: true },
13321331
}),
13331332
update: async () => ({}),
13341333
},

‎packages/tui/test/cli/tui/composer-keymap.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ async function renderComposer(
103103
const app = await testRender(
104104
() => (
105105
<TestTuiContexts directory={directory}>
106-
<ConfigProvider config={createTuiResolvedConfig({ keybinds, session: { terminal: false } })}>
106+
<ConfigProvider config={createTuiResolvedConfig({ keybinds }, { terminal: false })}>
107107
<Keymap.Provider>
108108
<ClientProvider api={createApi(calls.fetch)}>
109109
<DataProvider directory={process.cwd()}>

‎packages/tui/test/cli/tui/data.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function emitEvent(events: ReturnType<typeof createEventStream>, event: OpenCode
4343
events.emit({ ...event, location: { directory } })
4444
}
4545

46-
const config = createTuiResolvedConfig({ session: { terminal: false } })
46+
const config = createTuiResolvedConfig({}, { terminal: false })
4747

4848
function DataProvider(props: ParentProps) {
4949
return (

‎packages/tui/test/component/dialog-shell-output.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ async function setup(width: number, output = "") {
6666
const app = await testRender(
6767
() => (
6868
<TestTuiContexts directory={temporary.path} paths={{ state: temporary.path }}>
69-
<ConfigProvider config={createTuiResolvedConfig({ session: { terminal: false } })}>
69+
<ConfigProvider config={createTuiResolvedConfig({}, { terminal: false })}>
7070
<RouteProvider initialRoute={{ type: "session", sessionID: "ses_fixture" }}>
7171
<ClientProvider api={api}>
7272
<DataProvider directory={temporary.path}>

‎packages/tui/test/fixture/tui-runtime.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ type ResolvedInput = Omit<Info, "attention" | "keybinds" | "leader"> & {
77
leader?: { timeout?: number }
88
}
99

10-
export function createTuiResolvedConfig(input: ResolvedInput = {}) {
11-
return resolve(input, { terminalSuspend: process.platform !== "win32" })
10+
export function createTuiResolvedConfig(input: ResolvedInput = {}, options?: { terminal?: boolean }) {
11+
const config = resolve(input, { terminalSuspend: process.platform !== "win32" })
12+
return {
13+
...config,
14+
session: { ...config.session, terminal: options?.terminal ?? config.session.terminal },
15+
}
1216
}

‎packages/tui/test/session-wheel-focus.test.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ test.each([80, 120, 180])("session wheel scrolling preserves pane focus at width
7676
app: { name: "test", version: "test", channel: "test" },
7777
server: { endpoint: { url: server.url.toString() } },
7878
config: {
79-
get: async () => ({ animations: false, session: { terminal: true }, tabs: { enabled: false } }),
79+
get: async () => ({ animations: false, tabs: { enabled: false } }),
8080
update: async () => ({}),
8181
},
8282
packages: { prepare: async () => ({ directory: "" }) },

0 commit comments

Comments
 (0)