Commit graph

8 commits

Author SHA1 Message Date
randogoth
9f28569fef shell-init: record the first command of every shell in atuin
bash-preexec arms its DEBUG trap from __bp_interactive_mode at the end of
PROMPT_COMMAND, but its lazy installer runs mid-way through the first prompt
because zoxide and ghostty append their hooks after it. Those hooks disarm the
trap again, so the first interactive command of every session never reached
preexec and atuin silently dropped it.

Arm from PS0 instead, which is expanded once per interactive command before the
DEBUG trap and is therefore independent of PROMPT_COMMAND ordering.

Also guard the script against running twice: it is installed as both
loginShellInit and interactiveShellInit, and /etc/profile sources /etc/bashrc,
which registered starship's precmd/preexec hooks twice in every login shell.
2026-08-28 16:06:09 +03:00
randogoth
b7bb444f3d fix(shell): let bash-preexec install last so atuin preexec fires
Eagerly calling __bp_install at source time made bash-preexec install
before starship/atuin/zoxide/ghostty modified PROMPT_COMMAND, so their
hooks landed after __bp_interactive_mode. bash-preexec then never marked
typed commands as interactive and skipped preexec_functions, so atuin's
__atuin_preexec never fired and history stopped recording
(ATUIN_PREEXEC_BACKEND stuck at "<shlvl>:none").

Remove the eager __bp_install and the manual PROMPT_COMMAND/array wiring
for starship, atuin and zoxide; each tool registers with bash-preexec
itself, and deferred install on the first prompt keeps
__bp_interactive_mode last (verified against bash-preexec 0.6.0).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-11 16:13:30 +03:00
randogoth
09d1587e9f shell init log permission fix 2026-02-05 07:41:25 +02:00
randogoth
38647526ff fix(shell): avoid shared /tmp shell-init.log 2026-02-05 07:32:54 +02:00
randogoth
85b21cc6ea Revert "fix(shell): disable init logging by default"
This reverts commit e4fcf78b09.
2026-02-05 07:28:38 +02:00
randogoth
e4fcf78b09 fix(shell): disable init logging by default 2026-02-05 07:24:59 +02:00
randogoth
b6e2e95371 Enable virt-manager and streamline shell init 2026-02-03 18:36:21 +02:00
randogoth
879754cb8d Add shell module and bootstrap fixes 2026-02-02 22:07:23 +02:00