Skip to content

Profile: opencode-zellij

S4 · Deterministic 🔬 Research

Keybinding profile optimized for OpenCode with Zellij multiplexer and cross-device SSH access.


  • Zellij in locked mode — Keys go to app by default, Ctrl+G unlocks
  • VS Code terminal passthrough — Keys pass to terminal, not VS Code
  • Flow control disabled — Ctrl+S/Q available for apps
  • Session helpersz, zk, zl commands with autocomplete

Terminal window
# 0. Install dependencies
sudo apt install jq zellij # jq for smart session matching
# 1. Copy Zellij config
mkdir -p ~/.config/zellij
cp zellij/config.kdl ~/.config/zellij/config.kdl
# 2. Add bashrc helpers
cat >> ~/.bashrc << 'EOF'
# OpenCode-Zellij profile helpers
source /path/to/profiles/bashrc-snippets/zellij-helpers.sh
source /path/to/profiles/bashrc-snippets/opencode-helpers.sh
source /path/to/profiles/bashrc-snippets/flow-control.sh
EOF
source ~/.bashrc
# 3. (Optional) Merge VS Code settings
# Copy settings from vscode/settings.json into your VS Code settings

FilePurposeInstall To
zellij/config.kdlLocked mode, Ctrl+G unlock~/.config/zellij/config.kdl
vscode/settings.jsonTerminal key passthroughMerge into VS Code settings
vscode/keybindings.jsonCustom keybindingsMerge into VS Code keybindings

KeyAction
dDetach from session
nNew tab
xClose current pane
qQuit Zellij
|Split vertical
-Split horizontal
h/j/k/lNavigate panes
1-4Go to tab
Esc or Ctrl+GRe-lock
CommandAction
oSmart picker — lists sessions for current directory (uses fzf if installed)
ocQuick continue — continues most recent session for current directory
onStart fresh session (skip picker)
zAttach to last Zellij session or create new
z myprojectAttach/create “myproject” session
z my<TAB>Autocomplete session names
zk myprojectKill “myproject” session
zlList all sessions
zfixFix terminal size (WSL resize bug workaround)

Session picker (o) keybindings:

KeyAction
EnterContinue selected session
Ctrl-NNew session (prompts for task description)
ESCCancel (do nothing)

Note: o and oc match sessions by working directory, solving OpenCode’s global session bug. Your first message becomes the session title.


Auto-locks Zellij when OpenCode/vim is running:

Terminal window
# Download plugin
mkdir -p ~/.config/zellij/plugins
curl -L https://github.com/fresh2dev/zellij-autolock/releases/latest/download/zellij-autolock.wasm \
-o ~/.config/zellij/plugins/zellij-autolock.wasm
# Already configured in this profile's config.kdl