Skip to content

bug: keyboard exit shortcuts non-functional on plugin routes #20069

@YumaKakuya

Description

@YumaKakuya

I'm building a plugin that registers a custom route with
api.route.register(). When the user navigates to that route,
Ctrl+C, Ctrl+D, and leader+q all do nothing. The only way out is
killing the process from another terminal.

This happens because exitOnCtrlC is set to false in app.tsx, and
the three existing keyboard handlers that compensate for it
(dialog handler, session handler, selection handler) all have
guards that skip plugin routes. There's no fallback handler for
route.data.type === "plugin".

Minimal repro:
export default {
name: "repro",
setup(api) {
api.route.register("repro", () =>
Trapped.)
api.command.register("repro", {
description: "Go to repro route",
run: () => api.route.navigate("repro"),
})
},
}

Navigate to the route, press Ctrl+C. Nothing happens.

This is related to #2999 and #6644 but scoped narrowly to plugin
routes only. Not proposing any changes to the broader Ctrl+C
behavior.

OpenCode version: 1.3.3
OS: Ubuntu 24.04.4 LTS (WSL2 — Linux
5.15.167.4-microsoft-standard-WSL2)
Terminal: WSL2 default terminal

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingopentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions