# Latch Keep pinned tabs open. ## Use Pin a tab to protect it. Unpin it to close it. Latch prevents the close command from unpinning your tab, even after repeated presses of **Cmd+W / Ctrl+W**. It also blocks direct tab removal, including the native close button and plugins that use Obsidian's standard tab-removal method. A brief notice explains a blocked close. Unpinned tabs behave normally. No settings or hotkey changes are needed. ## Install Latch is available in the Obsidian community directory. 1. Install **Latch** from Obsidian's Community plugins, or download `main.js` and `manifest.json` from the [latest release](https://github.com/fourth-form/latch/releases/latest). 2. Create `.obsidian/plugins/latch/` inside your vault and copy both files into it. 3. Restart Obsidian and enable **Latch** in Settings → Community plugins. Disable other tab-closing protection plugins to avoid conflicting behavior. Disable Latch at any time to restore normal closing behavior. ## Limits Requires Obsidian **1.13.7 or later**. Tested on macOS; Windows and mobile are not yet tested. Latch protects individual tab closure. It does not block quitting, closing an entire pop-out window, switching workspace layouts, or replacing a tab's content. A plugin that bypasses the guarded closing methods may bypass protection. ## Privacy No network requests, telemetry, note-content access, or vault-file writes. Latch changes tab-closing behavior only. ## Develop Use Node.js 20 or later. No dependencies to install. ```sh npm run check ``` This builds `main.js` from `src/` and runs the tests. Obsidian supplies the runtime API. The generated file is committed so release assets can be compared with the source. - `src/main.js`: startup, notices, and error reporting. - `src/protection.js`: the rule for protecting a tab. - `src/obsidian.js`: Obsidian hooks and cleanup. - `tests/`: behavior and simulated integration tests. See [architecture](docs/architecture.md) for the contract and compatibility boundary, and [releasing](docs/releasing.md) for the release process. ## License [MIT](LICENSE)