Skip to content

Conversation

@justcarlson
Copy link
Owner

Summary

  • Add Zellij configuration with zjstatus plugin for git-aware status bar
  • Add dev layout (40/60 split) with nvim + shell panes
  • Configure autostart on workspace 3 via Hyprland

Closes #126

Changes

New Files

File Purpose
.config/zellij/layouts/zjstatus.kdl Single-pane layout with zjstatus
.config/zellij/layouts/zjstatus-dev.kdl Dev layout (40/60 nvim + shells)
.config/zellij/integration.{fish,bash} Shell hooks for live git status
.local/bin/zellij-git-status Git status script for status bar
.local/bin/zellij-update-theme Theme sync script

Modified Files

File Change
.config/fish/config.fish Source zellij integration
.bashrc Source zellij integration
.config/hypr/autostart-opencode.conf Autostart zellij on workspace 3
lib/packages.sh Add zellij to package registry
AGENTS.md Documentation updates

Testing

  • Verified autostart works after reboot
  • Git status updates correctly when navigating directories
  • Named "dev" session persists and can be reattached

Note

⚠️ uv binary (52MB) included - may want to add to .gitignore or use Git LFS in future.

- Add zellij config with zjstatus plugin layouts (single-pane and dev split)
- Add zellij-git-status script for live git info in status bar
- Add shell integrations (fish/bash) for pipe-based status updates
- Add zellij-update-theme for theme synchronization
- Configure autostart on workspace 3 via Hyprland
- Update AGENTS.md docs and add zellij package to registry

Closes #126
@claude
Copy link

claude bot commented Jan 3, 2026

Code Review: feat(zellij): add zjstatus dev environment with git status bar

Summary

This PR adds Zellij terminal multiplexer configuration with zjstatus plugin for git-aware status bar display. The implementation is comprehensive and well-documented.


🚨 Critical Issues

1. Security: Hardcoded SSH Credentials in Config

# .bashrc and config.fish
alias agents='ssh -i ~/.ssh/acfs_ed25519 ubuntu@100.74.195.52'

Issue: This exposes:

  • SSH key path (~/.ssh/acfs_ed25519)
  • Username (ubuntu)
  • IP address (100.74.195.52)

Recommendation: Remove this alias from tracked dotfiles. Store sensitive connection details in ~/.secrets or use SSH config (~/.ssh/config) which isn't tracked.

2. Binary Files Committed: uv and uvx (52MB+)

omarchy-config/.local/bin/uv   (binary)
omarchy-config/.local/bin/uvx  (binary)

Issue: Large binaries bloat repository history permanently and become stale quickly.

Recommendation:

  • Add *.local/bin/uv and *.local/bin/uvx to .gitignore
  • Install via package manager or official installer instead
  • If binaries are required, use Git LFS

3. Binary WASM File: zjstatus.wasm

omarchy-config/.config/zellij/plugins/zjstatus.wasm

Issue: Plugin binary will become stale and increases repo size.

Recommendation: Add installation instructions to README (already present - curl command), add to .gitignore, or use Git LFS.


⚠️ Potential Bugs

1. Broken Path in env Scripts

# omarchy-config/.local/bin/env
export PATH="$HOME/.local/share/../bin:$PATH"

Issue: $HOME/.local/share/../bin normalizes to $HOME/.local/bin, but this is confusing and non-idiomatic. Same issue in env.fish.

Recommendation: Use the direct path: $HOME/.local/bin

2. Broken Symlinks in Typora Themes

Multiple symlinks point to non-existent paths:

../../../.dotfiles/omarchy-config/.config/Typora/themes/github.css

These assume a specific directory structure that may not exist.

3. Typo in config.fish Integration

# Line appears to be truncated in diff
source ~/.confi  # Should be ~/.config/zellij/integration.fish

Verify this line is complete in the actual file.


📋 Code Quality

Positive Observations

  • ✅ Comprehensive README documentation for Zellij
  • ✅ Shell integration for both Bash and Fish
  • ✅ Proper use of shellcheck compatible patterns
  • ✅ Follows project structure conventions (omarchy-config/ mirroring ~/)
  • ✅ Package registry updated correctly in lib/packages.sh
  • ✅ Good separation of layouts (compact, dev, zjstatus variants)

Suggestions

  1. zellij-git-status script improvements:

    • Add set -euo pipefail for stricter error handling
    • The wc -l | tr -d ' ' pattern could be simplified to wc -l (or use $(( )))
  2. zellij-update-theme script:

    • Uses sed -i without backup flag (GNU sed behavior differs from BSD sed)
    • Consider: sed -i.bak for safety
  3. AGENTS.md consolidation:

    • Good simplification of documentation, but ensure essential workflow info isn't lost

🔐 Security Concerns

Issue Severity File
SSH alias with hardcoded credentials High .bashrc, config.fish
Opencode PATH export exposes username Low .bashrc

🧪 Test Coverage

  • ✅ Manual testing documented in PR description
  • ⚠️ No automated tests for new shell scripts (zellij-git-status, zellij-update-theme)
  • Consider adding basic shellcheck validation for new scripts

📦 Performance

  • Shell integration hooks (__zjstatus_git_update) run on every prompt
  • Uses disown to prevent blocking - good practice
  • Git operations are lightweight (status, rev-parse)
  • watch -t -n 2 in git-dev layout adds minimal overhead

Recommended Actions Before Merge

  1. Must fix:

    • Remove SSH alias with hardcoded credentials from tracked files
    • Add uv, uvx to .gitignore and remove from tracking
  2. Should fix:

    • Add zjstatus.wasm to .gitignore (install via curl instead)
    • Fix confusing path in env scripts
    • Verify Typora symlinks or remove broken ones
  3. Nice to have:

    • Add shellcheck step for new bin scripts
    • Add set -euo pipefail to shell scripts

Overall Assessment

This is a solid addition that brings modern terminal multiplexer support with git integration. The configuration is well-documented and follows project conventions. However, the security issues (exposed SSH credentials) and large binary files should be addressed before merging.

Recommendation: Request changes for security fixes, approve after addressing critical issues.


🤖 Generated with Claude Code

@claude
Copy link

claude bot commented Jan 3, 2026

Code Review: feat(zellij): add zjstatus dev environment with git status bar

This is a substantial PR adding Zellij terminal multiplexer configuration with git-aware status bar integration. Overall, the implementation is well-structured with comprehensive documentation. However, there are several issues that should be addressed before merging.


Security Concerns

1. Hardcoded SSH credentials in tracked files (Critical)

Both .bashrc and config.fish contain a hardcoded SSH alias with a private key path and IP address:

alias agents='ssh -i ~/.ssh/acfs_ed25519 ubuntu@100.74.195.52'

This violates the project's own guidelines in AGENTS.md:

"Store secrets in ~/.secrets (chmod 600)" and "Commit API keys or secrets: Never"

While the private key itself isn't committed, the alias should be in ~/.secrets to avoid exposing infrastructure details (IP, username, key location).

Recommendation: Move this alias to ~/.secrets and source it from there as intended.

2. Broken symlinks in Typora themes (Bug)

The new symlinks in omarchy-config/.config/Typora/themes/old-themes/ point to non-existent paths:

../../../.dotfiles/omarchy-config/.config/Typora/themes/github.css

This relative path assumes ~/.dotfiles exists as a sibling to .config, which doesn't match the standard Stow symlink structure. These symlinks will be broken after stow omarchy-config.


Code Quality Issues

3. Binary WASM file committed (Major)

The PR commits zjstatus.wasm (a binary plugin file) directly to the repository. The PR description itself notes:

"uv binary (52MB) included - may want to add to .gitignore or use Git LFS in future."

While zjstatus.wasm is much smaller, binary files should generally not be committed. Consider:

  • Adding installation instructions in the README (already partially there)
  • Adding the .wasm file to .gitignore
  • Letting users download it on first use

4. Hardcoded paths in layouts

In zjstatus-dev.kdl:

pane size="60%" focus=true cwd="~/s"

The cwd="~/s" is a personal directory that won't exist for other users of this dotfiles repo. Consider using ~ or making this configurable.

5. Hardcoded timezone

In both zjstatus.kdl and zjstatus-dev.kdl:

datetime_timezone "America/New_York"

This should either be removed (to use system default) or made configurable.


Best Practices

6. PATH manipulation concerns

In .local/bin/env:

export PATH="$HOME/.local/share/../bin:$PATH"

The path $HOME/.local/share/../bin evaluates to $HOME/.local/bin. This is confusing and should just be $HOME/.local/bin directly.

7. Missing shebang validation

The script zellij-git-status uses bash-specific features ([[ ]], (( ))), which is fine, but the .bashrc sources it via PROMPT_COMMAND. Consider adding set -euo pipefail for robustness.

8. Potential race condition in shell integration

The bash integration spawns background processes:

zellij pipe "zjstatus::pipe::pipe_git::${git_status}" &>/dev/null &
disown &>/dev/null

While this is non-blocking, it could lead to many orphaned processes if the user runs many commands quickly. Consider adding rate limiting or debouncing.


Positive Aspects

  • Excellent documentation: The README.md for Zellij is comprehensive with clear installation steps, keybinding reference, and usage examples
  • Good shell integration: Both Fish and Bash are supported with proper environment detection
  • Clean separation: Layouts are well-organized and follow consistent patterns
  • Proper convention: Package added to PACKAGE_REGISTRY as per project guidelines
  • Test checklist completed: The PR description indicates testing was performed

Summary

Severity Count Items
Critical 1 Hardcoded SSH alias with credentials
Bug 1 Broken Typora symlinks
Major 1 Binary WASM committed
Minor 4 Hardcoded paths/timezone, confusing PATH logic, shell robustness

Recommendation: Address the security concern (#1) and the broken symlinks (#2) before merging. The binary file (#3) and other issues can be addressed in follow-up PRs if preferred.


Generated with Claude Code

- Remove SSH alias with hardcoded credentials from .bashrc and config.fish
- Add zjstatus.wasm to .gitignore (install via curl per README)
- Remove broken Typora symlinks in old-themes directory
- Simplify PATH in env scripts ($HOME/.local/share/../bin → $HOME/.local/bin)
@claude
Copy link

claude bot commented Jan 3, 2026

Code Review: feat(zellij): add zjstatus dev environment with git status bar

Overall this is a solid addition that provides a productive terminal multiplexer setup with git-aware status bar integration. Here's my detailed feedback:


✅ What's Good

  1. Clean architecture - Shell integration scripts are well-organized with separate files for Bash and Fish
  2. Proper package registration - Zellij added to PACKAGE_REGISTRY following project conventions
  3. Good documentation - Comprehensive README with installation instructions and keybinding reference
  4. AGENTS.md cleanup - The consolidated, table-based format is much more scannable
  5. Removal of stale theme CSS - Deleting github.css (416 lines) reduces cruft

🐛 Potential Issues

1. Hardcoded path in .bashrc

export PATH=/home/jc/.opencode/bin:$PATH

Problem: Hardcoded username jc will break for other users/machines.
Suggestion: Use $HOME instead:

export PATH="$HOME/.opencode/bin:$PATH"

2. Hardcoded path in zjstatus-dev.kdl

pane size="60%" focus=true cwd="~/s"

Problem: ~/s is a personal directory that likely doesn't exist elsewhere.
Suggestion: Use ~ or make this configurable via a layout variant.

3. Missing shellcheck compliance in zellij-git-status

The script uses [[ ]] bash-specific syntax which is fine, but the shebang is #!/bin/bash. Consider:

  • Running shellcheck on this script in CI (not currently in glob pattern)
  • The regex [[ "$x" =~ [MADRC] ]] works but could use quoting for clarity

4. Race condition in shell integration

zellij pipe "zjstatus::pipe::pipe_git::${git_status}" &>/dev/null &
disown &>/dev/null

Running this in background on every prompt could accumulate zombie processes if zellij pipe is slow. Consider rate-limiting or checking if a previous update is still pending.


🔒 Security Considerations

  1. zellij-update-theme uses sed -i on config - This is safe but ensure the theme file source is trusted (it's from the local Omarchy theme system, so this is fine)

  2. Sourcing .secrets in .bashrc - Already present and properly guarded with [[ -f ~/.secrets ]]


⚡ Performance Notes

  1. Git status on every prompt - zellij-git-status runs git status --porcelain and git rev-list on every prompt. In large repos this could add latency. Consider:

    • Caching the result for a few seconds
    • Only running when $PWD changes
  2. Background process spawning - The & disown pattern is lightweight but frequent spawning adds overhead


🧪 Test Coverage

No tests added for the new scripts. Consider:

  • Adding shellcheck validation for zellij-git-status and zellij-update-theme
  • A simple test that verifies the scripts are executable and have valid syntax

📝 Minor Suggestions

  1. Fish integration line 4: &> is bash syntax. In Fish it should be &>/dev/null or 2>/dev/null. Verify this works correctly in Fish.

  2. Comment in autostart-opencode.conf line 11: Says "Uses -n flag to force new session" but -n is actually --layout name, not force-new. The -s dev creates the session.

  3. env script in .local/bin/: Good addition for PATH management, but it's POSIX sh - consider if you want this sourced somewhere.


📊 Summary

Category Status
Code quality ⚠️ Minor issues (hardcoded paths)
Best practices ✅ Good separation of concerns
Performance ⚠️ Git status on every prompt may be slow in large repos
Security ✅ No concerns
Test coverage ❌ No new tests

Recommendation: Address the hardcoded paths before merging. The performance items are nice-to-haves that can be addressed in follow-up PRs.


🤖 Generated with Claude Code

@claude
Copy link

claude bot commented Jan 3, 2026

Code Review: feat(zellij): add zjstatus dev environment with git status bar

Thanks for this PR! The Zellij configuration with zjstatus integration looks like a solid addition to the dotfiles. Here is my review:


High Priority Issues

1. Hardcoded Home Directory Path in .bashrc

The PATH export uses a hardcoded /home/jc path which breaks for any user other than jc. This should use the HOME environment variable instead.

2. Race Condition in zellij-update-theme

The temp file replacement pattern is vulnerable to race conditions. Consider using mktemp for safer atomic file operations with proper trap cleanup.


Medium Priority Issues

3. Missing Quoting on PATH Export

The PATH export should use proper quoting to prevent issues with paths containing spaces.

4. Complex Autostart Command

The autostart-opencode.conf command is dense and hard to maintain. Consider extracting to a dedicated script for readability and easier debugging.

5. awk getline Edge Cases in zellij-update-theme

The getline usage in the awk script could behave unexpectedly if the comment line is not followed by another line or if brace matching is off in the config. Consider adding validation.


Low Priority Suggestions

6. Shebang Portability

Scripts use #!/bin/bash. For better portability, consider using #!/usr/bin/env bash.

7. Missing set -euo pipefail

Consider adding strict mode to shell scripts, or at least set -o pipefail to catch pipe failures.

8. PATH Deduplication in .bashrc

Unlike fish_add_path (which handles this automatically), bash does not deduplicate PATH entries. Consider adding a check before appending.

9. Fish disown May Be Unnecessary

In integration.fish, fish 3.x handles background jobs automatically with &, so disown may be unnecessary.


What Looks Good

  • Well-structured PR with clear summary, change list, and testing checklist
  • Proper secret handling with file existence check before sourcing
  • Smart session reuse with attach-or-create pattern for named sessions
  • Good Fish idioms with proper use of fish_add_path and status is-interactive
  • zjstatus integration with well-implemented shell hooks for live git status
  • Defensive coding with git rev-parse check before git operations
  • Thorough documentation in the zellij README.md
  • Good .gitignore updates to exclude WASM plugins and large binaries

Summary

The PR is well-structured and adds useful functionality. The main blocking issue is the hardcoded home directory path which should be fixed before merging. The other items are improvements that could be addressed now or in follow-up PRs.

Overall: Approve with requested changes (fix the hardcoded path)

- Only update git status when PWD changes or after 2 second interval
- Prevent race conditions with update guard flag (bash)
- Fix fish syntax: use >/dev/null 2>&1 instead of &>
@claude
Copy link

claude bot commented Jan 3, 2026

Code Review: feat(zellij): add zjstatus dev environment with git status bar

Summary

This PR adds a comprehensive Zellij terminal multiplexer setup with git-aware status bar integration. It is a well-organized feature that follows the repository conventions.


Positive Highlights

  • Follows repo conventions: Package correctly added to PACKAGE_REGISTRY, configs placed in omarchy-config/ mirroring ~/
  • Good documentation: Comprehensive README.md with installation steps, keybindings, and usage examples
  • Thoughtful cleanup: Removed old/unused Typora theme file (416 lines), streamlined AGENTS.md documentation
  • Shell integration: Supports both Bash and Fish with rate-limiting to prevent excessive git status updates
  • Defensive coding: Scripts check for $ZELLIJ environment variable to avoid issues in non-Zellij contexts

Issues to Address

Security Concerns

  1. Hardcoded PATH in .bashrc (omarchy-config/.bashrc:20)
    This hardcodes a specific username (jc). Should use $HOME:

    # Current:
    export PATH=/home/jc/.opencode/bin:$PATH
    # Should be:
    export PATH="$HOME/.opencode/bin:$PATH"
  2. Hardcoded directory in zjstatus-dev layout (layouts/zjstatus-dev.kdl:61-63)
    The cwd="~/s" is a personal directory that will not exist for other users. Consider using cwd="~" or making this configurable.

Potential Bugs

  1. Missing executable bit (omarchy-config/.local/bin/env)
    The env script has a shebang but is not marked executable in the diff. The other scripts (zellij-git-status, zellij-update-theme) show 100755 mode but this one shows 100644.

  2. Race condition in bash integration (integration.bash:45-46)
    The __zjstatus_updating flag is set to 0 immediately after starting the background process, not after it completes. This defeats the race condition protection. Consider removing this flag or implementing proper locking.

  3. Potential silent failure in zellij-update-theme (zellij-update-theme:39-42)
    The awk pattern matching could silently fail if the file format changes, leaving the config in an inconsistent state.

Code Quality

  1. Duplicate PATH setup

    • omarchy-config/.local/bin/env adds ~/.local/bin to PATH
    • omarchy-config/.config/fish/config.fish also adds it via fish_add_path
    • .bashrc sources secrets but does not source the new env script

    Consider consolidating the PATH setup approach.

  2. Commented-out code (autostart-opencode.conf:15)
    The alternative launch command is commented out. If it is meant as documentation, the README already covers this.


Performance Considerations

  1. Git status script efficiency (zellij-git-status)
    The script runs 6+ git commands on every update. In large repositories, this could add latency. Consider using git status --porcelain=v2 which provides more info in one call.

Test Coverage

  1. No tests added - The PR adds shell scripts (zellij-git-status, zellij-update-theme) but no corresponding tests. Consider adding basic tests for:
    • zellij-git-status output format in various git states
    • zellij-update-theme handling of missing/malformed theme files

Minor Suggestions

  1. Timezone hardcoded (zjstatus.kdl:60, zjstatus-dev.kdl:48)
    datetime_timezone "America/New_York" - Consider using system timezone or making this configurable.

  2. PR note about uv binary - The .gitignore update already addresses the concern mentioned in the PR description about the uv binary.


Summary

Overall: This is a solid, well-documented feature addition. The main items to address before merging:

  • Fix the hardcoded /home/jc/ path (security/portability issue)
  • Fix the hardcoded cwd="~/s" in the layout
  • Consider adding basic tests for the new scripts

The documentation improvements to AGENTS.md are a nice bonus, making the file more scannable while preserving essential information.

@justcarlson justcarlson merged commit 629d4f8 into main Jan 4, 2026
8 checks passed
@justcarlson justcarlson deleted the feat/zellij-zjstatus-dev-environment branch January 4, 2026 01:47
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.

feat: add zellij + zjstatus dev environment with git status bar

2 participants