fix: sync shell working directory for suggestions (#78)
## Summary - synchronize the shell current working directory with Iris over the existing IPC pipe - use the synchronized directory for file, workspace, Git, and history suggestions on macOS - preserve the Linux `/proc/<pid>/cwd` and process-CWD fallbacks - update zsh, bash, and fish integrations while preserving command exit status ## Problem On macOS, `/proc/<pid>/cwd` is unavailable, so `GetCWD` fell back to the directory where Iris was launched, usually `$HOME`. After changing directories in the shell, file suggestions could therefore continue to come from `$HOME`. ## Tests - `go test -race ./spec` - `go test ./root -run ^'$'` - `go test ./... -run ^'$'` - generated zsh, bash, and fish hook syntax checks Co-authored-by: Pavel Naumov <Pavel.Naumov@berekebank.kz>
This commit is contained in:
co-authored by
Pavel Naumov
parent
cee756e2c1
commit
9f43fcb352
@@ -386,6 +386,11 @@ func runWrapper() {
|
||||
for scanner.Scan() {
|
||||
query := scanner.Text()
|
||||
|
||||
if cwd, ok := strings.CutPrefix(query, "IRIS_CWD:"); ok {
|
||||
spec.SetCWD(cwd)
|
||||
continue
|
||||
}
|
||||
|
||||
if query == "IRIS_CMD_START" {
|
||||
isCommandActive.Store(true)
|
||||
bufferMu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user