feat(bw): scoped vault sessions, bw-shell, vw picker, Enter guard #66
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
public/dotfiles-public!66
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/bw-scoped-sessions"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Three related changes so the vault is open only as long as needed, unlocked with one OnlyKey slot press.
Session model (
dot_config/shell/bitwarden.sh):BW_SESSIONis a bearer key. Before this changebw-unlockand thevw-*helpers exported it into the login shell and never locked again.bw-*/vw-*helper now unlocks for one call and locks afterwards._bw_scopedruns in a subshell whose EXIT trap locks, even on Ctrl-C.bw-shell [minutes]holds one session for a batch of commands and locks on exit or afterBW_SHELL_MINUTES(15).bw-unlockopens one, andbwrun <cmd>scopes any command.vault→HH:MMwhile a bw-shell is open.vwpicker (dot_config/zsh/vaultwarden.zsh):vw [-q|-k] [query]unlocks once per run.-qquits after one copy;-kreturns to the list until q.VW_PICK_MINUTES, then killed and locked.Enter guard (
dot_config/zsh/accept-guard.zsh): a command line whose first word zsh can't run is discarded instead of executed. A mistimed OnlyKey press at a shell prompt then never puts the master password into zsh history, atuin (synced) or tmux-resurrect's pane captures. Ctrl-Y restores a typo, andZSH_ACCEPT_GUARD=0turns it off. It chains to the existing accept-line, so syntax highlighting keeps working.Tested against a stub bw, a fake fzf and a fake clipboard (harness kept outside the repo):
No secret reaches stderr, the list or the preview.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XMf4ELq1Q12cmKnPuwJz2x