Repository navigation
Conversation
When the text before the cursor matches a trigger's regex, its text is written to the pane, like iTerm2's Send Text triggers (e.g. answering a Password: prompt). A trigger fires once per match, and is skipped on the alternate screen and while a pane is replaying on attach. The grid lives in the GUI process, so matching runs in the reader thread after each batch of output is fed to the emulator. Triggers come from the new `triggers` list in config.json and follow config reloads.
A prompt that exactly fills the row leaves the cursor on its last cell with a wrap pending, and one longer than the row soft-wraps; both were matched without their tail or head. The line is now built into a buffer the reader keeps instead of a fresh String per batch.
A list of the config's triggers, each with a switch and a form for its name, regex and text. The text is shown with its control characters as escapes, so a trailing Return reads as \r. Changes reach open panes at once.
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
|
The Linux failure is The same test fails with the same exception on other branches, including |
|
CI is green now. The earlier Linux failure was the flaky pwsh_reports_the_full_prompt_cycle_over_a_real_pty_on_unix test, and it passed on a re-run with no code changes. Whenever you have time, I'd appreciate a review. A quick summary of what this adds:
Happy to split it up, rename things, or change the config shape if you'd prefer a different direction. |
What
Adds triggers, in the spirit of iTerm2's Send Text trigger: when the line before the cursor matches a regular expression, tty7 types a configured text into the pane. The usual use is answering a prompt such as
Password:or a 2FA menu during an SSH login.They can also be edited under Settings → Triggers (list of rows with an enable switch, and a form for name / regex / text).
How
Config.triggers: Vec<Trigger>(name,regex,text,enabled), parsed leniently likecustom_shells.AlacEvent::PtyWrite, the same path query replies take.Password:in the replay must not be answered again).Limits worth knowing
config.jsonin plain text. The docs and the settings page say so.Password:will also match. Regexes should be specific.Testing
Password:through aRemoteTerminaland expects thePtyWrite.cargo test -p tty7 --bin tty7-app: 2604 passed.cargo fmt --checkandcheck-host-boundary.share clean.The settings page is covered by the existing settings tests (search catalog, i18n coverage) but has had little hands-on use so far, and the
ja/rustrings would benefit from a native speaker's look.