Skip to content

fix: create the login shell's config file, and test every shell's install path in CI - #19

Merged
AnnatarHe merged 2 commits into
mainfrom
claude/gifted-brahmagupta-l9w5ij
Nov 10, 2026
Merged

AnnatarHe merged 2 commits into
mainfrom
claude/gifted-brahmagupta-l9w5ij

Conversation

@AnnatarHe

@AnnatarHe AnnatarHe commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Shell Installation Test has failed on main on every run since at least #14, always in test-shells. In run 67, five of its six jobs failed. Two failures were workflow bugs and two were install bugs.

Why each job failed

Job Error in "Verify installation" Cause
ubuntu / macOS bash bash-preexec.sh not found Workflow: there was no bash install step, so install.bash never ran
ubuntu zsh zsh:source:1: no such file or directory: ~/.zshrc Workflow: the setup step ran mkdir -p ~/.zsh (a directory), not ~/.zshrc. Install: install.bash only writes to an existing ~/.zshrc
macOS zsh same Install: the macOS runner has no ~/.zshrc, just like a fresh Mac, so the hook is never sourced
macOS fish source: ... config.fish: No such file or directory Install: config.fish was only created on the manual path. The Homebrew path (#6) skipped it

The zsh failure is a real user bug. Reproduced on Linux: run as a zsh user (SHELL=zsh) with no ~/.zshrc, the installer writes no PATH line and no hook, then prints reload this one: source ~/.zshrc, and that command fails. It came in with the [ -f ... ] guards in #5, and it is the default case on macOS.

The old bash check was also hollow. bash -c "source ~/.bashrc" runs non-interactively, where Ubuntu's default ~/.bashrc returns before the shelltime lines, so it passed whether or not the hook worked.

Changes

install.bash: before either install path runs, it creates the login shell's config file ($SHELL: ~/.zshrc or ~/.bashrc) if it is missing. It still creates config.fish whenever fish is installed, but now on the Homebrew path too.

test.yaml:

  • Adds a bash install step.
  • Each install step runs bash ./install.bash from its shell with $SHELL set to that shell (the runner's own login shell is bash).
  • Removes the setup step, so the installer runs in the runner's real home directory.
  • The verify step checks what each path really installs:
    • macOS (Homebrew): brew list --cask shelltime, both binaries linked in brew's bin, and no ~/.shelltime/bin/shelltime shadowing them.
    • Linux (manual): both binaries in ~/.shelltime/bin, and the config puts that folder on PATH.
    • Both: every hook plus bash-preexec.sh exist, ~/.shelltime/daemon exists, and the login shell's config sources its hook.
    • Then: a new interactive shell must load the hook's functions and resolve shelltime to the expected binary.

No check was dropped: bash-preexec.sh is still required on both paths, and the ~/.shelltime/bin check now applies only to the manual path, which is the only one that writes there.

CLAUDE.md: the testing section now describes these checks.

Testing

On Linux, I extracted the workflow's own install and verify scripts and ran them for zsh, bash and fish, each in a fresh HOME. All three pass. Negative cases, each failing with its own message:

  • the old install.bash with zsh: ~/.zshrc was not created
  • a missing source line: does not source the <shell> hook
  • a hook file replaced by an error page (404: Not Found): a new <shell> shell did not load the hook
  • Ubuntu's skeleton ~/.bashrc passes with bash -i; bash -c does not load the hook.

The macOS (Homebrew) jobs could not be run locally. This PR's CI run is their test.


Generated by Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Since the config writes were guarded by `[ -f ... ]` (#5), a shell with no
config file got no PATH entry and no hook, and the installer still told the
user to `source` that file, which failed. That is the default on macOS: zsh is
the login shell and there is no ~/.zshrc. The Homebrew path (#6) also skipped
creating config.fish, which only the manual path did, so a fish user who
installed through brew got no hook either.

Before either path runs, the login shell's config file ($SHELL: ~/.zshrc or
~/.bashrc) is created when missing, and config.fish whenever fish is
installed, as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014EpZRbbdpnwmwxMATVJtHM
…stall path

- The bash jobs had no install step, so install.bash never ran and the verify
  step failed on the missing bash-preexec.sh. They now run it from bash.
- Each install step sets $SHELL to its shell, as for a user whose login shell
  it is (the runner's is bash), so the installer handles that shell's config.
- The setup step is gone: it made a ~/.zsh directory rather than ~/.zshrc and
  seeded config files users may not have. The macOS runner has no ~/.zshrc,
  like a fresh account.
- Verify checks what each path really installs. macOS (Homebrew): the cask is
  installed, both binaries are linked into brew's bin and nothing in
  ~/.shelltime/bin shadows them. Linux (manual): both binaries are in
  ~/.shelltime/bin and the config puts it on PATH. Both: every hook and
  bash-preexec.sh, the daemon dir, and the login shell's config sourcing its
  hook. Then a new interactive shell must load the hook's functions and run
  that shelltime. The old bash check sourced ~/.bashrc non-interactively, where
  Ubuntu's default ~/.bashrc returns before the shelltime lines, so it passed
  either way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014EpZRbbdpnwmwxMATVJtHM
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T15:28:54.860577Z 7c9854d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@shelltime

shelltime Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

☁️ Claude Code cloud · Fix shell installation test matrix and installer behavior

Fixed the shell installation workflow so each matrix job runs the installer under its intended shell and verifies the correct configuration.

💰 Cost 🔢 Tokens ⏱️ Duration 🧠 Model 💬 Prompts ✏️ Lines
$3.74 7.5M 30m (8m active) claude-opus-5-5 1 +84 / −35

7.5M tokens: 81 input · 45.7K output · 7.3M cache read · 169.3K cache write

📝 AI summary

Updated .github/workflows/test.yaml to correct the test-shells matrix behavior. The workflow now invokes install.bash for the selected shell instead of allowing bash matrix jobs to skip installation while running unrelated Zsh/Fish steps, and the verification logic was aligned with the shell-specific installation results across Ubuntu and macOS.

Adjusted /home/user/installation/install.bash to support the corrected CI execution and shell configuration behavior. Also updated CLAUDE.md with relevant repository guidance. The investigation used repository reads, shell commands, and targeted edits to diagnose the consistently failing main/PR workflow runs and implement the fixes in the three affected files.

View this session on ShellTime →

Updated 2026-11-11 15:28 UTC by ShellTime · totals for the whole session so far · the session page is visible to its owner

@AnnatarHe
AnnatarHe merged commit 0d67d16 into main Nov 10, 2026
8 of 9 checks passed
@AnnatarHe
AnnatarHe deleted the claude/gifted-brahmagupta-l9w5ij branch November 10, 2026 15:38
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