# nu-bang Nushell bang-command bridge for Pi. Runs Pi `!` and `!!` shell input through Nushell. Adds Nushell completions for bang input. Requires `nu` in `PATH`. ## Install / load Loaded through the root pi-ext package. See [root README](../../README.md). ## Commands / tools / settings - Commands: none - Tools: none - Hooks: `user_bash`, `session_start`, `session_shutdown` - Settings: none ## Behavior - `user_bash` replaces Pi shell operations with Nushell execution for the Pi-provided command. - Commands run as `nu -l --no-history --error-style fancy --table-mode none -c `. - Stdout and stderr stream back through Pi shell execution. - Execution receives Pi cwd, env, abort signal, and timeout. - Working directory is checked before execution and completion. - Abort and timeout send `SIGTERM`, then `SIGKILL` after 250 ms if the process group is still alive. - `session_start` wraps the current autocomplete provider. - Bang completion strips leading `!` or `!!` before asking Nushell for completions. - Bang completion uses `nu -l --no-history --error-style fancy -I --ide-complete /command.nu`. - Completion temp files live in `pi-nu-bang-*` temp dirs and are removed after use. - Non-bang completion delegates to the existing provider. - Bang completion failures fall back to the existing provider unless the request was aborted. - Completion prefix detection handles pipes, spaces, cell paths, quoted paths, and escaped-space paths. - Completion application replaces the current Nushell token and removes a stale closing quote when needed. - Bang input always allows file-completion triggering; non-bang input delegates that decision. - Completion JSON accepts Nushell's normal output and salvages malformed quoted list items. - `session_shutdown` removes temporary completion dirs still tracked by the extension.