Repository navigation
Conversation
| @@ -400,7 +400,7 @@ export namespace Config { | |||
| .default("ctrl+x") | |||
| .describe("Leader key for keybind combinations"), | |||
| app_help: z.string().optional().default("<leader>h").describe("Show help dialog"), | |||
| app_exit: z.string().optional().default("ctrl+c,<leader>q").describe("Exit the application"), | |||
| app_exit: z.string().optional().default("ctrl+d,ctrl+c,<leader>q").describe("Exit the application"), | |||
There was a problem hiding this comment.
I've updated all locations the exit commands are enumerated
00e992e to
6a02b7f
Compare
|
Is this still draft or is it ready for review? |
6a02b7f to
bc8f1ed
Compare
Still draft. Finishing testing changes from our talk in the thread. |
| @@ -388,7 +387,8 @@ func LoadFromConfig(config *opencode.Config, customCommands []opencode.Command) | |||
| { | |||
| Name: AppExitCommand, | |||
| Description: "exit the app", | |||
| Keybindings: parseBindings("ctrl+c", "<leader>q"), | |||
| // NOTE: ctrl+c requires a double press to exit while ctrl+d requires a single press | |||
| Keybindings: parseBindings("ctrl+c", "ctrl+d", "<leader>q"), | |||
| } | ||
|
|
||
| // 9. Handle exit key debounce for app exit when using non-leader command | ||
| if exitCommand.Matches(msg, a.app.IsLeaderSequence) && keyString != "ctrl+d" { |
There was a problem hiding this comment.
I decided a separate block was cleanest. exitCommand is now defined here and used in this block and just below.
| // Skip interrupt key if we're in debounce mode and app is busy | ||
| if interruptCommand.Matches(msg, a.app.IsLeaderSequence) && a.app.IsBusy() && a.interruptKeyState != InterruptKeyIdle { | ||
| return a, nil | ||
| } | ||
| // Skip ctrl+d immediate exit key if the editor has content. Allow editor update commands to handle it as forward delete. | ||
| if exitCommand.Matches(msg, a.app.IsLeaderSequence) && keyString == "ctrl+d" && a.editor.Length() > 0 { | ||
| return a, nil |
There was a problem hiding this comment.
This allows the later fall through on next cycle into step 12 further below.
|
@rekram1-node whenever you have time, it's out of draft. Tests for Go and TS passed locally. I'm going to look at the |
bc8f1ed to
695355f
Compare
|
anddd the opentui version just shipped I would've said something if I knew it was shipping today I can still merge this into old branch tho since we are keeping v0 alive for time being |
RIP. Okay. Before putting time into the |
|
U can go ahead! |
This adds support for ctrl+d to exit the app. It follows the unix convention of only requiring a single press of the command. Additionally, it updates the help menu to reflect the new keybind.
695355f to
913a0fb
Compare
|
@rekram1-node rebased to point this branch at |
|
amazin |
|
Hey, going to close this at this point. Feel free to reopen if wanted for v0 build. |

Problem
Pressing
ctrl+dshould terminate OpenCode. Claude Code and Codex support similar behavior (Claude Code with two presses, Codex with one), and Unix tools typically require one press to exit programs as well.See #3025 for more details of the problem statement.
Solution
I opted to roll this new functionality into the existing
AppExitCommandcode. I added a separate block to control the newctrl+dapp exit (on single press) but also preserved the existing forward delete functionality when the text editor has content in it.I also updated all locations I could find with the new keybinding information, including where it's displayed for
/help.Testing
Below is videos showing testing on all major platforms.
Screen.Recording.2025-10-31.at.11.27.15.AM.mov
Screen.Recording.2025-10-31.at.11.44.51.AM.mov
Screencast.from.2025-10-31.14-30-01.webm