Commit Graph
23 Commits
Author SHA1 Message Date
VERSE 45d182f072 fix: terminal hangs, right arrow blocking, and runaway iris processes (#142)
closes #137

- right arrow consumed the escape sequence without forwarding it, so the
cursor couldn't move back right after moving left (60149a2)
- p10k's instant prompt redirects stdout to a temp file that exec iris
inherits, sending the overlay there instead of the terminal and looking
like a dead keyboard. Reopens /dev/tty when stdout isn't a terminal
(7ebbb0c)
- zsh/bash autostart lacked the interactivity check fish already had, so
agentic tools sourcing your rc file spawned a rogue iris that seized
/dev/tty (5fe58be)
2026-08-13 10:54:12 +07:00
VERSE 87b91c45d7 feat: update changelog (#131)
closes #130 

- CHANGELOG.md file for people who can view changelog from github
---
`iris changelog` command:
`iris changelog [version]` (e.g. iris changelog v0.5.1)
`iris changelog -n 3` (see changelog of 3 latest releaseas)

=> `iris changelog` looks just like CHANGELOG.md, grouped headers and
all. It only stops looking that way if we personally overwrite that
release's description with something else
=> With 1-hour local cache (invalidated on updater-channel change),
`--refresh` flag to bypass, graceful fallback to stale cache on GitHub
rate-limiting

---
- New auto update config
```toml
# 0 = off (default, notify only), 1 = auto-install, 2 = always confirm first
auto-update = 1
```

- New just debug-changelog and just debug-autoupdate recipes (fully
offline, mocked HTTP servers, no real network/config touched)
2026-08-07 17:16:18 +07:00
VERSE fc1634b007 fix: start iris in multiplexer panes instead of inheriting a dead one (#120)
closes #62
when you open a new Zellij pane, the shell inherits Iris’s environment
variables, so it thinks Iris is already running. But the pane doesn't
inherit the underlying connection (FD 13), so suggestions silently fail
into a dead pipe

the old code only checked for `tmux` by process name, ignoring Zellij
completely

- Fixed:

instead of checking for specific app names, Iris now tracks the active
terminal device (`IRIS_TTY`)

if a new shell detects that it's on a different `TTY` than Iris, it
clears the stale environment variables so Iris can start fresh. The
`IRIS_PID != PPID` check prevents Iris from trying to re-exec itself
when spawning sub-shells.

```sh
if [ -n "$IRIS_PID" ] && [ "$IRIS_PID" != "$PPID" ] && [ "${TTY:-$(tty 2>/dev/null)}" != "$IRIS_TTY" ]; then
    unset IRIS_PID IRIS_IS_CHILD IRIS_FD IRIS_TTY
fi

```
2026-08-06 15:42:56 +07:00
Ashvin Singh dfaa051f31 fix: make Right Arrow configurable and correct overlay positioning (#110)
## Summary

Closes #108

This PR fixes two issues related to terminal interaction and rendering:

- Make Right Arrow ghost acceptance configurable instead of hard-coded.
- Correct overlay positioning when the shell prompt wraps across
terminal lines.

## Changes

### Right Arrow configuration

- Add a new `navigate-right` keybinding to the configuration.
- Add `navigate-right = "right"` to the default configuration to
preserve existing behavior.
- Update the wrapper to use the configured binding instead of a
hard-coded Right Arrow check.
- Forward the Right Arrow escape sequence to the PTY when
`navigate-right` is unset, allowing the shell or terminal to handle it
normally.

### Overlay positioning

- Compute the cursor's current column from the total visual width
instead of using the accumulated width directly.
- Correctly handle wrapped prompts by calculating the cursor column
modulo the terminal width.
- Clamp the overlay position so it never extends beyond the terminal
width.
- Extend debug logging with the computed cursor position to aid
troubleshooting.

## Why

Right Arrow ghost acceptance was previously implemented as a hard-coded
behavior, making it impossible to disable or remap through
configuration. This change makes it consistent with the existing
configurable keybindings while preserving the default behavior.

Overlay positioning assumed that the prompt length represented the
cursor's current column. When the prompt wrapped onto a new terminal
line, this assumption caused the suggestion overlay to be positioned
incorrectly. Computing the cursor column from the wrapped position
ensures the overlay is aligned with the actual cursor.

## Testing

- [x] Default configuration retains Right Arrow ghost acceptance.
- [x] Setting `navigate-right = ""` forwards Right Arrow to the shell.
- [x] Existing keybindings continue to function as before.
- [x] Overlay is correctly positioned for both short and wrapped
prompts.
- [x] Overlay remains within terminal bounds.
2026-08-03 18:48:53 +07:00
VERSE a885c7462a feat(config): ui width, auto exec, selection and navigation configs (#80)
closes #67

So I made an auto-exec confg `auto-exec = true`
(e32c0ba6ed69f3c764353e58b8fbacf160f37d5a) which means:
- If you want your command in the prompt to be executed right away, you
can set this = false (for example, you are typing `nvim ~/.conf` but
IRIS is suggesting `nvim ~/.config`, it will ignore the suggestion and
exec what you are typing, this is current default behavior)
- If you want to auto execute full command which is being suggested, you
can set this = true (this is the opposite of above, when you are typing
`nvim ~/.conf` but IRIS is suggesting `nvim ~/.config`, it will auto
exec `nvim ~/.config` instead, but sometime you want to exec what you
are typing instead of the suggestion right?, just press esc or shift tab
to hide the menu and it will)

---

Select keybinding to replace tab
(0dc01cba8c610e8d6fd8c50f6a71bdcc061a098f)
`select = "ctrl+y"`

Some users may love nvim keybinding or emacs, so I bring navigation
keybinding to be configurable (0dc01cba8c610e8d6fd8c50f6a71bdcc061a098f)
```
navigate-up = "ctrl+k"
navigate-down = "ctrl+j"
```
---

I also added a option for UI width
(dfa3b810a7be406fe4652b3886020f37bb166811)
`max-width = 80`
- If you configure `max-width` to be larger than the actual width of the
current terminal, Iris will automatically "compress" the window to match
the terminal's width (meaning it will never overflow and break the
interface)
- If you configure `max-width` too small (e.g 10), the interface will
have cramped text, making it look very bad. So, I've set a minimum safe
min limit of 40. If the configured value is smaller than this, Iris will
automatically use 40

Small note: If you set `max-width = 0` (or leave it blank), it will
automatically use Iris's default standard size of 76. SO you can
confidently customize it without fear of breaking the UI (I hope so
lmao)

---

Added a fallback to ensure Iris never crashes or loses shortcuts if the
user accidentally deletes keybinding configuration lines or
intentionally assigns empty strings " "
(f682c9bf623f3ed46ad0763221145604dbd91b07)

Fix typo `toggle_mode` to `toggle-mode`
(b39be6673e552735fa65a6c9807510c83b4d9cdd)

if you have a better config design, please tell me, I always listen to
your idea
2026-07-31 10:49:10 +07:00
Pavel NaumovandPavel Naumov 9f43fcb352 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>
2026-07-31 10:01:05 +07:00
Paolo Ricciuti 2573ad73b4 feat: add shell login option (#75)
Closes #72
2026-07-30 22:45:23 +07:00
VERSE 812d73b42a fix: iris stops working after exec a command in bash (#66)
Fix #65

when the user presses Enter to run a command, Iris sets `isCommandActive
= true` so it knows a command is running and skips rendering the
overlay. After the command finishes, `isCommandActive` needs to reset to
`false` for Iris to work again. In zsh/fish, preexec/precmd hooks send
an `IRIS_CMD_STOP` signal over the IPC pipe, which Iris receives to
reset `isCommandActive = false`. Bash has no equivalent hook, so
`IRIS_CMD_STOP` is never sent and `isCommandActive` stays stuck at true
forever

so I added a bash-only fallback inside `isExecuting()`: if
`isCommandActive` is true but `TIOCGPGRP` (a kernel API) confirms the
shell's process group is back in the foreground (meaning the command
finished), automatically reset `isCommandActive` to false. zsh/fish
still rely on IPC signals as before

also added a `PROMPT_COMMAND` hook to iris init bash to `send
IRIS_CMD_STOP` after every command (belt-and-suspenders), though that's
not the main fix
2026-07-29 23:00:13 +07:00
d73921e419 fix: stdin handling and exit command (#58)
### Summary of Changes
Fixes **#53** (*Fish shell integration panics with `inappropriate ioctl
for device`*).
#### 1. Fixed Non-TTY Stdin (`panic: inappropriate ioctl for device`) —
Fixes #53
- **Root Cause**: When executing `iris init fish | source` (or sourcing
shell configs), `os.Stdin` (FD 0) is connected to a pipe instead of a
TTY. Calling `term.MakeRaw()` on
a pipe returns `ENOTTY`.
- **Fix**: Guarded `term.MakeRaw()` with `term.IsTerminal()` checks
across `root/wrapper.go` and `root/root.go`. Added fallback to open and
use `/dev/tty` when `os.Stdin` is
  not a terminal device.
- **Fish IPC Hooks**: Added `fish_preexec` and `fish_postexec` event
handlers to `iris init fish` to send `IRIS_CMD_START` / `IRIS_CMD_STOP`
IPC signals over `$IRIS_FD`.
  
#### 2. Fixed Shell Setup Order (Duplicate `fastfetch` / startup
executions) — Fixes #53
- **Root Cause**: `iris setup` appended the init script to the bottom of
shell configs (`config.fish`, `.zshrc`, `.bashrc`), causing pre-existing
interactive startup commands
  to run twice.
- **Fix**: Updated `setupCmd` in `root/init.go` to **prepend** `# Iris
Autocomplete` to the top of shell configuration files.
  
#### 3. Fixed Terminal Exit Loop Handling — Relates to #50
- **Root Cause**: When typing `exit` in the wrapped shell, Linux PTY
returns `syscall.EIO` (`Input/output error`) on `ptmx.Read()` rather
than `io.EOF`. `runWrapper()` was
ignoring non-EOF errors and looping indefinitely without restoring the
terminal or calling `os.Exit(0)`.
- **Fix**: Updated the `ptmx.Read` error handler in `root/wrapper.go` to
handle `syscall.EIO` and exit cleanly.
  
   ---
  
  ### Issues Addressed
   - Closes #53
   - Relates to #50, #55
  
   ---
  
  ### Verification Tested
- [x] Verified `iris setup fish` / `iris init fish | source` initializes
without `ioctl` panic.
- [x] Verified typing `exit` in Fish, Zsh, and Bash terminates IRIS
cleanly and restores standard terminal state.
   - [x] Ran `go test ./...` — all tests pass.

---------

Co-authored-by: verse91 <versedev.store@proton.me>
Co-authored-by: VERSE <sunnyone0901@gmail.com>
2026-07-29 21:28:48 +07:00
VERSE d6cfb9c909 feat(config): add some more config options (#64)
## Add
Make these things configurable
- Expand aliases
- Suggest hidden files (#59)
- Toggle menu and mode 

```
[ui]
hidden-files = true # or false

[core]
expand-alias = true # or false

[keybindings]
toggle-mode = "ctrl+r"
toggle-menu = "ctrl+space"
```

- Auto reload config on changes: now just changes config and save the
file, IRIS will auto detect and reload in silent
- Added all these in config on init and docs

## Fix
I tested on holding backspace and the ghost text keep glitching so I
fixed it, this is just a small fix
2026-07-29 20:43:46 +07:00
VERSE ebb0bead7d fix: ZDOTDIR and XDG_CONFIG_HOME config detecting (#51)
From this discussion:

https://www.reddit.com/r/zsh/comments/1v8rq7s/comment/p09b05o/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

---

Problem: Iris hardcodes config paths to `~/.zshrc` and
`~/.config/fish/config.fish`. This ignores users' custom `ZDOTDIR` or
`XDG_CONFIG_HOME` setups, polluting their `$HOME` directory during init
and failing to scan their actual aliases. Also, ZDOTDIR is often set in
`~/.zshenv` without export, making it invisible to Go's `os.Getenv`

Solution:
- Bash: default `$HOME/.bashrc` so dont mind about it
- For Zsh, Iris now probes zsh directly (`zsh -c "echo $ZDOTDIR"`) with
a timeout to accurately resolve custom paths even if they aint exported
- For Fish, Iris now natively respects the `XDG_CONFIG_HOME` environment
variable
- Shared this robust resolution logic across init, uninstall, and alias
scanning
- Fixed alias scanning to process files in the correct zsh startup order
(`.zshenv` -> `.zprofile` -> `.zshrc`) and correctly merge them
2026-07-28 21:46:34 +07:00
VERSE 1e04949242 refactor: better project structure (#35)
This project is starting to grow, and I've seen flaws in the initial
project structure design
I think I'll restructure the entire project directory for better
scalability and also cleaner
2026-07-11 16:15:05 +07:00
VERSE ee1ef2dd73 feat(init): allow passing specific shell to setup command (#25) 2026-07-03 13:55:07 +07:00
VERSE ca9d30af9c fix: data race and overlay bugs (#20)
- redundant ghost text
- prompt deletion bug on overlay
- overlay bug on the non-exists commands

<img width="1152" height="221" alt="image"
src="https://github.com/user-attachments/assets/29ef0c1f-4cd8-4e36-960f-352010fc3bd1"
/>
<img width="1275" height="470" alt="image"
src="https://github.com/user-attachments/assets/aa765110-f9fa-49c8-94f2-767a827f5e5f"
/>
<img width="2517" height="152" alt="image"
src="https://github.com/user-attachments/assets/47a6668f-fb01-46be-9ad2-2c50c283f175"
/>
2026-07-03 12:29:42 +07:00
VERSE ea82216dc9 style(ui): redesign new menu (#18)
- 2 mode classic (the old one) and modern
a2a17cab3a4bdf27abd2a956f9d53a0c4a685909
- add icon 3a11c7a6beb1dcf11e89977f380376fdea9fba89
- fix some bugs
2026-07-03 11:50:35 +07:00
VERSE aca3d1670c fix: better suggestion and overlay movement on key presses (#12)
- support history suggestions for aliases
https://github.com/versenilvis/IRIS/commit/0ae25d05ce0faf8ff2eeee9aa3fbb5889d9ad511
- merge spec and history results
(https://github.com/versenilvis/IRIS/commit/315c94f12bb689ad6b39b1f0ce5e0bdef71f38d5)
- add 25ms pty throttle and optimize ctrl+l
(https://github.com/versenilvis/IRIS/commit/1e603d74c208be00f6b2cb79a628416455711c3a)
- align suggestion menu to col 1
(https://github.com/versenilvis/IRIS/commit/e307b210849af65276e93e1cff8895f3b54937ff)
- resolve zsh ipc fd mismatch and generate autocomplete hooks
(https://github.com/versenilvis/IRIS/pull/12/commits/2199607fad8122ec441ff4b99e562ca62bd948ff)
- fix: eliminate prompt duplication and freeze UI movement during menu
navigation
https://github.com/versenilvis/IRIS/pull/12/commits/6783989a49f0a68d01bad542588983a5c7b597a2
2026-07-01 16:11:38 +07:00
VERSE a2972f61f1 chore(commands): more commands for suggestions (#10)
## What's new
- color completion message command green
https://github.com/versenilvis/IRIS/pull/10/commits/6e141f5e6909fad1ec42725cce38d51729acf399
- new flat command folder structure
https://github.com/versenilvis/IRIS/pull/10/commits/87026a854a529ec5d5baed967d5f7a7f0085a24b
- fix some linter problems
https://github.com/versenilvis/IRIS/pull/10/commits/536de790cefda912f50bf4022e40ce2b965db2e2
- fix some gemini fix suggestions
2026-06-23 10:27:26 +07:00
VERSE 3d76a3ee88 feat: toml config support (#9)
## What's new
- TOML config support 
- add config init command to justfile
https://github.com/versenilvis/IRIS/pull/9/commits/a5bb6c23d74ca73385b3590d2eb275ce6429906b
- add copy binary file to local bin on reload
https://github.com/versenilvis/IRIS/pull/9/commits/4da3acdbc58c28f20fa0021d15fec82823ba392b
- init config on setup
https://github.com/versenilvis/IRIS/pull/9/commits/fb48b6bb832f38e24fab9211d92858bab9a58a07

## Fix
- add lsof to support macos because /proc filesystem is Linux-specific
and does not exist on macOS 0439d829573864fcf902fc4127f7d45384bfab01
- git push doesnt suggest current branch, fix
https://github.com/versenilvis/IRIS/pull/9/commits/b498532b401b764a4a1a2c70b3cb44b7caf72320
- use timeout context for lsof command in reload handler
https://github.com/versenilvis/IRIS/pull/9/commits/1a2baee951e6538a729da12aedfe53960e51102d
2026-05-30 22:05:06 +07:00
VERSE 8556fa626a fix: correct nightly tag, fix tmux startup, full-word suggestions only, and keep current dir on reload (#8)
- correct nightly release tag name
989b61eefb212c18ca04b2121b382f19f86e39c2
- iris not start in tmux 0fef95430b6a1877810e3a4ffd8aa658f75c542c
- suggestions only show on full word typing
f29cbfd74a2d90371f8f369e6f8e7419f979da38
- keep current dir on reload instead of return home dir
a923e78f52a95e06587aff6856a6a81319b38e84
2026-05-30 20:56:43 +07:00
verse91 c76541258a fix: all issues by golangci-lint 2026-05-09 23:49:33 +07:00
verse91 44ff34f378 fix(init): text file busy bug on setup 2026-04-27 16:06:36 +07:00
verse91 b6e5096092 feat(init): setup 2026-04-27 15:31:20 +07:00
verse91 5c8ac9e4a6 feat: run with terminal 2026-04-19 12:45:20 +07:00