Skip to content

refactor(pty-proxy): clean up tty ownership checks - #4565

Merged
atuin-bot merged 1 commit into
mainfrom
taylordotfish/pty-proxy-answer-cleanup
Oct 27, 2026
Merged

atuin-bot merged 1 commit into
mainfrom
taylordotfish/pty-proxy-answer-cleanup

Conversation

@taylordotfish

Copy link
Copy Markdown
Member

Followup to pty-proxy regression fix in #4519: instead of exposing the __atuin_pty_proxy_answer variable globally, switch back to having __atuin_pty_proxy_owns_tty be the source of truth, but give that variable three possible values instead of just 0 and 1:

  • 1: an atuin pty-proxy owns the current tty
  • 0: an atuin pty-proxy doesn't own the current tty, and we should try to spawn one
  • -1: an atuin pty-proxy doesn't own the current tty, but we should not try to spawn one

pty-proxy integration is gated behind owns_tty == 1, whereas spawning a new proxy is gated behind owns_tty == 0.

Also standardize the calculation of owns_tty across the normal shell init and pty-proxy init.

@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Replaces the separate cached detection answer with three-state ownership checks across Bash, Zsh, Fish, and Nushell.

  • Shell startup uses one ownership value to decide when a proxy can run.

Reviews (1) Β· Last reviewed commit: "refactor(pty-proxy): clean up tty owners..." Β· Reviewed by Greptile

@taylordotfish
taylordotfish marked this pull request as ready for review October 27, 2026 22:39
@taylordotfish

Copy link
Copy Markdown
Member Author

/merge

@atuin-bot

atuin-bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Landed as 773a77c. GitHub shows this merged once it reaches main.

Followup to pty-proxy regression fix in #4519: instead of exposing the `__atuin_pty_proxy_answer` variable globally, switch back to having `__atuin_pty_proxy_owns_tty` be the source of truth, but give that variable three possible values instead of just 0 and 1:

* 1: an atuin pty-proxy owns the current tty
* 0: an atuin pty-proxy doesn't own the current tty, and we should try to spawn one
* -1: an atuin pty-proxy doesn't own the current tty, but we should *not* try to spawn one

pty-proxy integration is gated behind `owns_tty == 1`, whereas spawning a new proxy is gated behind `owns_tty == 0`.

Also standardize the calculation of `owns_tty` across the normal shell init and pty-proxy init.
@atuin-bot
atuin-bot force-pushed the taylordotfish/pty-proxy-answer-cleanup branch from b372f3c to 773a77c Compare October 27, 2026 22:58
@atuin-bot
atuin-bot merged commit 773a77c into main Oct 27, 2026
4 checks passed
@atuin-bot
atuin-bot deleted the taylordotfish/pty-proxy-answer-cleanup branch October 27, 2026 22:59
atuin-bot pushed a commit that referenced this pull request Oct 29, 2026
### Bug Fixes

- *(ai)* Parse history and output tool arguments with serde and reject unknown ones ([#4554](#4554))
- *(client)* Keep the logging guard alive until the command finishes ([#4528](#4528))
- *(daemon)* Build kv and scripts after a sync, not only history ([#4544](#4544))
- *(daemon,sync)* Rebuild search index after `atuin sync` ([#4574](#4574))
- *(deps)* Bump ctutils and tokio for RUSTSEC-2026-0385 and -0386 ([#4525](#4525))
- *(deps)* Bump bandit to 1.14.0 and zstd to 0.14 for the open security advisories
- *(deps)* Bump docs gitpython to 3.2.1 for GHSA-83vg-56qc-22m7 ([#4559](#4559))
- *(deps)* Bump pulldown-cmark to 0.13.5 ([#4581](#4581))
- *(docker)* Ship patched ca-certificates in the server image ([#4522](#4522))
- *(i18n)* Say force *pull* in the store pull --force help ([#4523](#4523))
- *(login)* Restart the daemon on the new key when login changes it ([#4555](#4555))
- *(mcp)* Reject arguments a tool doesn't take instead of ignoring them ([#4553](#4553))
- *(pty-proxy)* Don't auto-spawn on Linux virtual consoles ([#4564](#4564))
- *(release)* Regenerate CONTRIBUTORS on every release ([#4561](#4561))
- *(scripts)* Name the editor when launching it fails ([#4533](#4533))
- *(server)* Check the password before deleting an account ([#4572](#4572))
- *(sync)* Stop re-downloading history the server doesn't have
- *(threads)* Stop reading claude code api-request blobs as messages ([#4538](#4538))
- *(threads)* Keep opencode subagent prompts and other dropped content ([#4546](#4546))
- *(threads)* Keep Claude Code recaps, safeguard notices, retried API errors and skill prompts ([#4547](#4547))
- *(threads)* Keep omp python runs, file mentions, narration and subagent links ([#4548](#4548))
- *(threads)* Keep codex subagent answers and voice transcripts, read compressed rollouts ([#4549](#4549))
- *(threads)* Ignore enter_accept for resume ([#4573](#4573))
- Undo i18n of `__internal` docs ([#4560](#4560))


### Features

- *(cli)* Categorized help via clap-couture ([#4384](#4384))
- *(common)* Userio::log macros and sinks for user messages ([#4562](#4562))
- *(dist)* Add a Windows MSI installer for atuin ([#4527](#4527))
- *(mcp)* Install for all configured agents with `atuin mcp install` ([#4557](#4557))
- *(search)* Add shell-up-key-binding keybinding condition ([#4552](#4552))
- *(server)* Add admin commands to create, reset and delete users ([#4526](#4526))
- *(threads)* Say how long writing the session file took before starting the harness ([#4537](#4537))
- More correct numeric math ([#4585](#4585))


### Miscellaneous Tasks

- Skip nix build, illumos and package on mono's land/* builds ([#4551](#4551))
- Move the Windows jobs to Buildkite ([#4571](#4571))


### Performance

- Improve search index performance ([#4586](#4586))


### Refactor

- *(client)* Report a wrong encryption key through a typed error ([#4529](#4529))
- *(deps)* Bump axoupdater from 0.10.0 to 0.10.3 ([#4539](#4539))
- *(deps)* Bump futures-util from 0.3.33 to 0.3.34 ([#4540](#4540))
- *(deps)* Bump serde_json from 1.0.151 to 1.0.154 ([#4541](#4541))
- *(deps)* Bump tokio-util from 0.7.19 to 0.7.20 ([#4542](#4542))
- *(deps)* Bump serde_with from 3.21.0 to 3.24.0 ([#4543](#4543))
- *(pty-proxy)* Clean up tty ownership checks ([#4565](#4565))


### Testing

- *(secrets)* Remove the redaction timing tests ([#4566](#4566))
renovate Bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Oct 30, 2026
##### [\`18.24.4\`](https://github.com/atuinsh/atuin/blob/HEAD/CHANGELOG.md#18244)

##### Bug Fixes

- *(ai-session)* Keep the objective of an opencode /goal ([#4599](atuinsh/atuin#4599))
- *(hooks)* Honour CLAUDE_CONFIG_DIR when installing Claude Code hooks ([#4597](atuinsh/atuin#4597))
- *(threads)* Open pi and omp sessions on the agent's default model ([#4598](atuinsh/atuin#4598))
- *(threads)* Take `claude` and `claude-code` alike wherever a harness is named ([#4602](atuinsh/atuin#4602))
- *(threads)* Restore a non-diverged session with no row before its parent ([#4604](atuinsh/atuin#4604))

##### Features

- *(cli)* Spooky atuin ([#4605](atuinsh/atuin#4605))
- *(threads)* Capture, search and resume GitHub Copilot CLI sessions ([#4567](atuinsh/atuin#4567))
- *(threads)* Capture Copilot subagents as child sessions ([#4568](atuinsh/atuin#4568))
- *(threads)* Write Copilot sessions: restore, catch up, switch, fork, continue ([#4580](atuinsh/atuin#4580))
- *(threads)* Name the recording host in threads JSON and atuin info ([#4600](atuinsh/atuin#4600))
- *(server)* Add support for X-Forwarded-For ([#4595](atuinsh/atuin#4595))

---
##### [\`18.24.3\`](https://github.com/atuinsh/atuin/blob/HEAD/CHANGELOG.md#18243)

##### Bug Fixes

- *(ai)* Parse history and output tool arguments with serde and reject unknown ones ([#4554](atuinsh/atuin#4554))
- *(client)* Keep the logging guard alive until the command finishes ([#4528](atuinsh/atuin#4528))
- *(daemon)* Build kv and scripts after a sync, not only history ([#4544](atuinsh/atuin#4544))
- *(daemon,sync)* Rebuild search index after `atuin sync` ([#4574](atuinsh/atuin#4574))
- *(deps)* Bump ctutils and tokio for RUSTSEC-2026-0385 and -0386 ([#4525](atuinsh/atuin#4525))
- *(deps)* Bump bandit to 1.14.0 and zstd to 0.14 for the open security advisories
- *(deps)* Bump docs gitpython to 3.2.1 for GHSA-83vg-56qc-22m7 ([#4559](atuinsh/atuin#4559))
- *(deps)* Bump pulldown-cmark to 0.13.5 ([#4581](atuinsh/atuin#4581))
- *(docker)* Ship patched ca-certificates in the server image ([#4522](atuinsh/atuin#4522))
- *(i18n)* Say force *pull* in the store pull --force help ([#4523](atuinsh/atuin#4523))
- *(login)* Restart the daemon on the new key when login changes it ([#4555](atuinsh/atuin#4555))
- *(mcp)* Reject arguments a tool doesn't take instead of ignoring them ([#4553](atuinsh/atuin#4553))
- *(pty-proxy)* Don't auto-spawn on Linux virtual consoles ([#4564](atuinsh/atuin#4564))
- *(release)* Regenerate CONTRIBUTORS on every release ([#4561](atuinsh/atuin#4561))
- *(scripts)* Name the editor when launching it fails ([#4533](atuinsh/atuin#4533))
- *(server)* Check the password before deleting an account ([#4572](atuinsh/atuin#4572))
- *(sync)* Stop re-downloading history the server doesn't have
- *(threads)* Stop reading claude code api-request blobs as messages ([#4538](atuinsh/atuin#4538))
- *(threads)* Keep opencode subagent prompts and other dropped content ([#4546](atuinsh/atuin#4546))
- *(threads)* Keep Claude Code recaps, safeguard notices, retried API errors and skill prompts ([#4547](atuinsh/atuin#4547))
- *(threads)* Keep omp python runs, file mentions, narration and subagent links ([#4548](atuinsh/atuin#4548))
- *(threads)* Keep codex subagent answers and voice transcripts, read compressed rollouts ([#4549](atuinsh/atuin#4549))
- *(threads)* Ignore enter_accept for resume ([#4573](atuinsh/atuin#4573))
- Undo i18n of `__internal` docs ([#4560](atuinsh/atuin#4560))

##### Features

- *(cli)* Categorized help via clap-couture ([#4384](atuinsh/atuin#4384))
- *(common)* Userio::log macros and sinks for user messages ([#4562](atuinsh/atuin#4562))
- *(dist)* Add a Windows MSI installer for atuin ([#4527](atuinsh/atuin#4527))
- *(mcp)* Install for all configured agents with `atuin mcp install` ([#4557](atuinsh/atuin#4557))
- *(search)* Add shell-up-key-binding keybinding condition ([#4552](atuinsh/atuin#4552))
- *(server)* Add admin commands to create, reset and delete users ([#4526](atuinsh/atuin#4526))
- *(threads)* Say how long writing the session file took before starting the harness ([#4537](atuinsh/atuin#4537))
- More correct numeric math ([#4585](atuinsh/atuin#4585))

##### Miscellaneous Tasks

- Skip nix build, illumos and package on mono's land/\* builds ([#4551](atuinsh/atuin#4551))
- Move the Windows jobs to Buildkite ([#4571](atuinsh/atuin#4571))

##### Performance

- Improve search index performance ([#4586](atuinsh/atuin#4586))

##### Refactor

- *(client)* Report a wrong encryption key through a typed error ([#4529](atuinsh/atuin#4529))
- *(deps)* Bump axoupdater from 0.10.0 to 0.10.3 ([#4539](atuinsh/atuin#4539))
- *(deps)* Bump futures-util from 0.3.33 to 0.3.34 ([#4540](atuinsh/atuin#4540))
- *(deps)* Bump serde_json from 1.0.151 to 1.0.154 ([#4541](atuinsh/atuin#4541))
- *(deps)* Bump tokio-util from 0.7.19 to 0.7.20 ([#4542](atuinsh/atuin#4542))
- *(deps)* Bump serde_with from 3.21.0 to 3.24.0 ([#4543](atuinsh/atuin#4543))
- *(pty-proxy)* Clean up tty ownership checks ([#4565](atuinsh/atuin#4565))

##### Testing

- *(secrets)* Remove the redaction timing tests ([#4566](atuinsh/atuin#4566))
eleboucher pushed a commit to eleboucher/homelab that referenced this pull request Oct 31, 2026
…) (#2495)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ghcr.io/atuinsh/atuin](https://github.com/atuinsh/atuin) | patch | `18.24.2` β†’ `18.24.4` |

---

> ⚠️ **Warning**
>
> Some dependencies could not be looked up. Check the [Dependency Dashboard](issues/567) for more information.

---

### Release Notes

<details>
<summary>atuinsh/atuin (ghcr.io/atuinsh/atuin)</summary>

### [`v18.24.4`](https://github.com/atuinsh/atuin/blob/HEAD/CHANGELOG.md#18244)

[Compare Source](atuinsh/atuin@v18.24.3...v18.24.4)

##### Bug Fixes

- *(ai-session)* Keep the objective of an opencode /goal ([#&#8203;4599](atuinsh/atuin#4599))
- *(hooks)* Honour CLAUDE_CONFIG_DIR when installing Claude Code hooks ([#&#8203;4597](atuinsh/atuin#4597))
- *(threads)* Open pi and omp sessions on the agent's default model ([#&#8203;4598](atuinsh/atuin#4598))
- *(threads)* Take `claude` and `claude-code` alike wherever a harness is named ([#&#8203;4602](atuinsh/atuin#4602))
- *(threads)* Restore a non-diverged session with no row before its parent ([#&#8203;4604](atuinsh/atuin#4604))

##### Features

- *(cli)* Spooky atuin ([#&#8203;4605](atuinsh/atuin#4605))
- *(threads)* Capture, search and resume GitHub Copilot CLI sessions ([#&#8203;4567](atuinsh/atuin#4567))
- *(threads)* Capture Copilot subagents as child sessions ([#&#8203;4568](atuinsh/atuin#4568))
- *(threads)* Write Copilot sessions: restore, catch up, switch, fork, continue ([#&#8203;4580](atuinsh/atuin#4580))
- *(threads)* Name the recording host in threads JSON and atuin info ([#&#8203;4600](atuinsh/atuin#4600))
- *(server)* Add support for X-Forwarded-For ([#&#8203;4595](atuinsh/atuin#4595))

### [`v18.24.3`](https://github.com/atuinsh/atuin/blob/HEAD/CHANGELOG.md#18243)

[Compare Source](atuinsh/atuin@v18.24.2...v18.24.3)

##### Bug Fixes

- *(ai)* Parse history and output tool arguments with serde and reject unknown ones ([#&#8203;4554](atuinsh/atuin#4554))
- *(client)* Keep the logging guard alive until the command finishes ([#&#8203;4528](atuinsh/atuin#4528))
- *(daemon)* Build kv and scripts after a sync, not only history ([#&#8203;4544](atuinsh/atuin#4544))
- *(daemon,sync)* Rebuild search index after `atuin sync` ([#&#8203;4574](atuinsh/atuin#4574))
- *(deps)* Bump ctutils and tokio for RUSTSEC-2026-0385 and -0386 ([#&#8203;4525](atuinsh/atuin#4525))
- *(deps)* Bump bandit to 1.14.0 and zstd to 0.14 for the open security advisories
- *(deps)* Bump docs gitpython to 3.2.1 for GHSA-83vg-56qc-22m7 ([#&#8203;4559](atuinsh/atuin#4559))
- *(deps)* Bump pulldown-cmark to 0.13.5 ([#&#8203;4581](atuinsh/atuin#4581))
- *(docker)* Ship patched ca-certificates in the server image ([#&#8203;4522](atuinsh/atuin#4522))
- *(i18n)* Say force *pull* in the store pull --force help ([#&#8203;4523](atuinsh/atuin#4523))
- *(login)* Restart the daemon on the new key when login changes it ([#&#8203;4555](atuinsh/atuin#4555))
- *(mcp)* Reject arguments a tool doesn't take instead of ignoring them ([#&#8203;4553](atuinsh/atuin#4553))
- *(pty-proxy)* Don't auto-spawn on Linux virtual consoles ([#&#8203;4564](atuinsh/atuin#4564))
- *(release)* Regenerate CONTRIBUTORS on every release ([#&#8203;4561](atuinsh/atuin#4561))
- *(scripts)* Name the editor when launching it fails ([#&#8203;4533](atuinsh/atuin#4533))
- *(server)* Check the password before deleting an account ([#&#8203;4572](atuinsh/atuin#4572))
- *(sync)* Stop re-downloading history the server doesn't have
- *(threads)* Stop reading claude code api-request blobs as messages ([#&#8203;4538](atuinsh/atuin#4538))
- *(threads)* Keep opencode subagent prompts and other dropped content ([#&#8203;4546](atuinsh/atuin#4546))
- *(threads)* Keep Claude Code recaps, safeguard notices, retried API errors and skill prompts ([#&#8203;4547](atuinsh/atuin#4547))
- *(threads)* Keep omp python runs, file mentions, narration and subagent links ([#&#8203;4548](atuinsh/atuin#4548))
- *(threads)* Keep codex subagent answers and voice transcripts, read compressed rollouts ([#&#8203;4549](atuinsh/atuin#4549))
- *(threads)* Ignore enter_accept for resume ([#&#8203;4573](atuinsh/atuin#4573))
- Undo i18n of `__internal` docs ([#&#8203;4560](atuinsh/atuin#4560))

##### Features

- *(cli)* Categorized help via clap-couture ([#&#8203;4384](atuinsh/atuin#4384))
- *(common)* Userio::log macros and sinks for user messages ([#&#8203;4562](atuinsh/atuin#4562))
- *(dist)* Add a Windows MSI installer for atuin ([#&#8203;4527](atuinsh/atuin#4527))
- *(mcp)* Install for all configured agents with `atuin mcp install` ([#&#8203;4557](atuinsh/atuin#4557))
- *(search)* Add shell-up-key-binding keybinding condition ([#&#8203;4552](atuinsh/atuin#4552))
- *(server)* Add admin commands to create, reset and delete users ([#&#8203;4526](atuinsh/atuin#4526))
- *(threads)* Say how long writing the session file took before starting the harness ([#&#8203;4537](atuinsh/atuin#4537))
- More correct numeric math ([#&#8203;4585](atuinsh/atuin#4585))

##### Miscellaneous Tasks

- Skip nix build, illumos and package on mono's land/\* builds ([#&#8203;4551](atuinsh/atuin#4551))
- Move the Windows jobs to Buildkite ([#&#8203;4571](atuinsh/atuin#4571))

##### Performance

- Improve search index performance ([#&#8203;4586](atuinsh/atuin#4586))

##### Refactor

- *(client)* Report a wrong encryption key through a typed error ([#&#8203;4529](atuinsh/atuin#4529))
- *(deps)* Bump axoupdater from 0.10.0 to 0.10.3 ([#&#8203;4539](atuinsh/atuin#4539))
- *(deps)* Bump futures-util from 0.3.33 to 0.3.34 ([#&#8203;4540](atuinsh/atuin#4540))
- *(deps)* Bump serde_json from 1.0.151 to 1.0.154 ([#&#8203;4541](atuinsh/atuin#4541))
- *(deps)* Bump tokio-util from 0.7.19 to 0.7.20 ([#&#8203;4542](atuinsh/atuin#4542))
- *(deps)* Bump serde_with from 3.21.0 to 3.24.0 ([#&#8203;4543](atuinsh/atuin#4543))
- *(pty-proxy)* Clean up tty ownership checks ([#&#8203;4565](atuinsh/atuin#4565))

##### Testing

- *(secrets)* Remove the redaction timing tests ([#&#8203;4566](atuinsh/atuin#4566))

</details>

---

### Configuration

πŸ“… **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

β™» **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

πŸ”• **Ignore**: Close this PR and you won't be reminded about these updates again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xODEuOSIsInVwZGF0ZWRJblZlciI6IjQ0LjE4MS45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://git.erwanleboucher.dev/eleboucher/homelab/pulls/2495
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants