Skip to content

[BUG REPORT] Ely's face follows the session shown, not the sessions - #109

Closed
ccjjfdyqlhy wants to merge 1 commit into
ELY-Open-Source:mainfrom
ccjjfdyqlhy:fix/ely-follows-the-session-shown
Closed

ccjjfdyqlhy wants to merge 1 commit into
ELY-Open-Source:mainfrom
ccjjfdyqlhy:fix/ely-follows-the-session-shown

Conversation

@ccjjfdyqlhy

Copy link
Copy Markdown
Contributor

Type

  • [FEATURE REQUEST]: a new feature or an improvement
  • [BUG REPORT]: a bug fix
  • [Other]: docs, refactoring, CI, dependencies or chores

What and why

Ely's face took the most pressing mark of every session, so a session in the background that had failed once kept her fretting while you worked in another one.
Only the mark of the session you are in reaches her now.

How

  • src/pet.rs: feeling reads the look of the session shown, and shown_mood picks that one look out of the sessions' looks, so a session in the background says nothing.
  • src/pet/look.rs: mood maps one look to one mood, and Mood loses the order that the fold over all the looks used.
  • src/workspace.rs: Workspace::shown gives the place of the session shown in the sessions' rows.
  • src/pet/tests.rs: a new test says that a session in the background which waits or fails no longer frets her.
  • src/pet/look/tests.rs: the test of the fold becomes a test of each look.
  • AGENTS.md, PRD.md, docs/en_us/features.md, docs/zh_cn/features.md, README.md, README_zh.md and tasks/acceptance.md say that she follows the session shown.

Bug details

  • Steps to reproduce: open a second session, run a command that fails in it, then switch back to the first one.
  • Expected: her face shows the session you are in, calm while that one is calm.
  • Actual: she raises her brows and shakes, with a drop running down, until the session in the background runs a command of its own.
  • Cause and fix: src/pet.rs collected the look of every session and look::mood kept the most pressing of them, so one stale failure in the background decided her mood for as long as it lasted. The failed flag of a session is sticky: it clears only when that session runs a command of its own. Now the look of the session shown is the only one that reaches her.

How it was tested

cargo test --lib pet
cargo clippy --all-targets -- -D warnings
cargo fmt --check
scripts/check.sh
  • cargo test --lib pet passes, 24 tests, with the new pet::tests::she_follows_the_session_shown_and_leaves_the_others_alone and the rewritten pet::look::tests::each_mark_asks_her_mood.
  • On a virtual X server I ran the app with RUST_LOG=elyterminal=debug, opened a second session, ran false in it and switched back to the first one. The log says pet: Ely feels Error, was Calm while the failing session was shown, and pet: Ely feels Calm, was Error right after the switch back.
  • I ran the same steps on the build of main before this change. It logs pet: Ely feels Error, was Calm and nothing after the switch back, so she keeps fretting over a command that failed in a session you are no longer in.
  • cargo fmt --check and cargo clippy --all-targets -- -D warnings are clean, and the 500 line rule and the one line comment rule of scripts/check.sh pass.
  • The whole suite has 23 failures here, all in term::shell and term::tap, because this machine has neither zsh nor fish. The same 23 fail on the pristine tree, so this change adds none.

Notes

  • The aggregate was deliberate. AGENTS.md says on 2026-10-18 that she opens with the sessions' mood, the PRD and the guides say she follows the sessions, and a test kept the fold. This PR changes that, so it is a behaviour change as much as a fix, and you may rather file it as a feature request.
  • What it gives up: she was the only surface that told you a session in the background waits on you when the sessions column is hidden. Each row still shows the state of its own session, a hidden session that waits has its title in bold, and a bell marks a hidden row, so the information stays in the column when the column shows.
  • If you still want her to stay sensitive to an error anywhere, tell me and I will add a setting for it: one that brings the old behaviour back, or one that only lets a session in the background that waits alert her.
  • I did not find an issue for this on the repository, so I did not open one and did not link one here.

Checklist

  • The title starts with [FEATURE REQUEST], [BUG REPORT] or [Other]
  • Tests and the build pass locally
  • Docs are updated if behaviour changed

@Raiden-MeixElysia

Raiden-MeixElysia commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Thanks. Merged with your authorship as 6508209 on main. A follow-up, c284ea2, makes the doc comments in src/pet.rs and src/pet/look.rs and Settings' Ely hint (English and Chinese) name the session shown too. Checked on macOS: a failing command in a second session made her fret, and switching back calmed her. It ships in 0.2.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants