npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

opencode-double-ctrl-c

v0.1.1

Published

OpenCode TUI plugin: press ctrl+c twice to exit, replicating Claude Code and Codex CLI. One press clears the prompt; on an empty prompt it asks for a second press instead of quitting.

Readme

opencode-double-ctrl-c

Press ctrl+c twice to exit OpenCode, the way Claude Code and Codex CLI do. Out of the box a single ctrl+c on an empty prompt quits the OpenCode TUI immediately, which is easy to hit by reflex in a long session. This plugin replicates the ctrl+c behaviour of Claude Code and Codex CLI:

  • text in the prompt → ctrl+c clears it
  • empty prompt → ctrl+c shows "ctrl+c again to exit"
  • second ctrl+c within 1.5 s → exits

Nothing else changes. Escape still interrupts a running turn, ctrl+d and /exit still quit.

Double-press exit is a long-standing feature request upstream (#9041, #26371, #10975); this is a plugin you can use today.

Install

opencode plugin opencode-double-ctrl-c -g

That installs the package into your global OpenCode config and adds it to tui.json. Drop -g to install it for the current project only. Restart OpenCode afterwards; plugins load at startup.

Without npm

TUI plugins are not auto-discovered, so a file install needs both steps:

mkdir -p ~/.config/opencode/tui-plugins
curl -fsSL https://raw.githubusercontent.com/tannerbruhn/opencode-double-ctrl-c/main/src/tui.ts \
  -o ~/.config/opencode/tui-plugins/double-ctrl-c.ts

Then add it to ~/.config/opencode/tui.json (create the file if it does not exist):

{
  "$schema": "https://opencode.ai/tui.json",
  "plugin": ["./tui-plugins/double-ctrl-c.ts"]
}

Do not put the file in ~/.config/opencode/plugin/. That directory is auto-discovered for server plugins and will try to load it the wrong way.

No keybind changes are required: the plugin registers ctrl+c at a priority above the built-in exit binding.

Options

"plugin": [["opencode-double-ctrl-c", { "window": 1500, "interrupt": false, "key": "ctrl+c" }]]
  • window – milliseconds allowed between the two presses. Default 1500. Codex CLI uses about 1000, Claude Code a little longer; set whichever you are used to.
  • interrupt – when true, the first press on an empty prompt stops a running turn instead of arming exit, which is what Claude Code and Codex CLI both do. Default false, because escape already does that in OpenCode.
  • key – the key to take over. Default ctrl+c.

If a single press still exits

Some builds may let the host's exit binding run first. If so, take ctrl+c off it in tui.json and the plugin does the rest:

"keybinds": { "app_exit": "ctrl+d,<leader>q" }

How it works

It registers one keymap layer with priority: 1000 and a single binding for ctrl+c. The command reads the focused prompt's text: if there is any, it dispatches OpenCode's own prompt.clear; otherwise it arms a timer and shows a toast, and a second press inside the window dispatches app.exit. With interrupt on, a busy session gets session.interrupt on the first press instead.

Requirements

OpenCode 1.18.18 or newer (the TUI plugin API with keymap layers). Tested on 1.18.26.

License

MIT