From 97d009f7ef6c0b9e020f69be155440fa7fa0a5ef Mon Sep 17 00:00:00 2001 From: verse91 Date: Sat, 11 Apr 2026 22:14:20 +0700 Subject: [PATCH] docs: add hot reload and shell aliases --- docs/root.md | 9 +++++++++ docs/spec.md | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/docs/root.md b/docs/root.md index dc1313f..b65060e 100644 --- a/docs/root.md +++ b/docs/root.md @@ -29,3 +29,12 @@ Provides `TermWrite`, a thread-safe wrapper around `os.Stdout`. It uses a `sync. 5. `overlay` renders the result `git`. 6. User presses `Tab`. 7. `root` sends `Ctrl+U` to Bash, then sends `git ` (the completion). + +## Hot-Reload + +IRIS features an **Atomic Hot-Reload** mechanism designed for rapid development: + +- **Signal Listener**: The root process listens for `SIGUSR1`. +- **Identity Exposure**: It exports `IRIS_PID` to the environment so child processes knows where to send the signal. +- **In-place Replacement**: Upon receiving the signal, Iris uses `syscall.Exec` to replace its current process image with the newly built binary. +- **Handoff Notification**: It uses `IRIS_RELOADED` to notify the new instance to announce its successful load. diff --git a/docs/spec.md b/docs/spec.md index dcc37cc..5d4150d 100644 --- a/docs/spec.md +++ b/docs/spec.md @@ -28,3 +28,12 @@ Input: `git com` 4. Stop walking. `partial` = `com`. 5. Suggestions: Look for subcommands of `git` starting with `com`. 6. Return: `git commit`. + +## Shell Aliases & Priority + +IRIS deeply integrates with your shell environment to provide a personalized experience: + +- **Dynamic Alias Parsing**: Scans `.bashrc`, `.zshrc`, and other configuration files for aliases. +- **Highest Priority**: Shell Aliases are given top priority in the suggestion engine, appearing above manual specs and system commands. +- **Token Injection**: If a root command is recognized as an alias (e.g., `gr` for `go run`), IRIS injects the expanded tokens into the lookup engine to provide accurate subcommand suggestions. +- **Display**: Suggestions for aliases show the expanded command (e.g., `tmux a -t`) while noting the alias name in the description (e.g., `alias: ta`).