Skip to content

Commit 0cd2973

Browse files
authored
Merge pull request #81 from AnExiledDev/fix/terminal-keybind-hardening
fix(container): harden shell terminal keybinds for Docker-attached panes
2 parents 360e113 + 1f1ed0f commit 0cd2973

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

container/.devcontainer/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Terminal
6+
7+
- **Shell terminal keybinds hardened** — disabled `Ctrl+Z` (suspend, which closes Docker-attached panes), `Ctrl+S/Q` (flow control freeze), and `Ctrl+W` (conflicts with Windows Terminal close-tab). Rebound `Ctrl+\` (SIGQUIT) to `Ctrl+]` and `Ctrl+D` (EOF) to `Ctrl+^` as emergency-only alternatives. Also unbound zsh's `Alt+W` (copy-region-as-kill) and `Alt+Q` (push-line) to free those keys for terminal use.
8+
59
### Hermes Agent
610

711
- **New feature: `hermes-agent`** — installs [Nous Research's Hermes Agent](https://hermes-agent.nousresearch.com/) CLI via the upstream `curl | bash` installer with `--skip-setup`. Hermes uses the plain `anthropic` / `openai` Python SDKs directly and supports any compatible provider (Anthropic, OpenAI, MiniMax, local models). Enabled by default; set `"version": "none"` in `devcontainer.json` to disable.

container/.devcontainer/scripts/setup-aliases.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,22 @@ if [ "\$TERM" = "xterm" ] || [ -z "\$TERM" ]; then
108108
fi
109109
export COLORTERM="\${COLORTERM:-truecolor}"
110110
111+
# Terminal keybind hardening — disable signals that cause problems in
112+
# Docker-attached panes (suspend closes pane, flow-control freezes
113+
# terminal). EOF and QUIT rebound to esoteric combos for emergency use.
114+
stty susp undef # Kill Ctrl+Z — suspend closes Docker-attached panes
115+
stty -ixon # Kill Ctrl+S/Q — flow control freezes terminal
116+
stty werase undef # Kill Ctrl+W — conflicts with Windows Terminal close-tab
117+
stty quit '^]' # Rebind Ctrl+\ (SIGQUIT) → Ctrl+] (emergency only)
118+
stty eof '^^' # Rebind Ctrl+D (EOF) → Ctrl+^ (emergency only)
119+
# zsh bindkey cleanup — stty handles the terminal layer, but zsh's line
120+
# editor has its own bindings that bypass stty or conflict with pane hotkeys
121+
if [ -n "\$ZSH_VERSION" ]; then
122+
bindkey -r '^W' # Remove backward-kill-word (stty werase already disabled)
123+
bindkey -r '^[w' # Remove copy-region-as-kill (unused emacs kill-ring op)
124+
bindkey -r '^[q' # Remove push-line (niche; frees Alt+Q for terminal use)
125+
fi
126+
111127
# Native binary (installed by claude-code-native feature)
112128
_CLAUDE_BIN="\$HOME/.local/bin/claude"
113129

0 commit comments

Comments
 (0)