Skip to content

feat(statusline): robust example statusline script with workspace, dual quotas, and tasks#625

Open
AndrewMason7 wants to merge 3 commits into
google-antigravity:mainfrom
AndrewMason7:feature/robust-statusline
Open

feat(statusline): robust example statusline script with workspace, dual quotas, and tasks#625
AndrewMason7 wants to merge 3 commits into
google-antigravity:mainfrom
AndrewMason7:feature/robust-statusline

Conversation

@AndrewMason7

Copy link
Copy Markdown

This PR improves the statusline example script (examples/statusline/statusline.sh) to make it robust, feature-rich, and secure.

Changes Made

  1. Critical Bug Fixes:

    • Startup Crash Fix: Resolved a POSIX command substitution newline stripping bug that caused the default script to crash with exit status 1 when set -e was active.
    • Crash-Resistant Sanitization: Added defensive type checking ([[ =~ ^[0-9]+$ ]]) so that empty, string, or corrupted payload fields from the CLI don't cause Bash arithmetic or comparison syntax errors.
    • Security/Robustness: Added escaping for backslashes in user-controlled strings (like branch names, model names, or directory paths) to prevent ANSI escape sequence injection.
  2. Feature Additions:

    • Workspace Directory Badge: Added the 📂 workspace name badge so developers know their active context.
    • Dual Quotas & Reset Timeframes: Extracts and displays both the 5-hour and weekly quotas with exact reset times (e.g., 5h: 54% (3h 45m) ╱ w: 23% (1d 17h)).
    • Active Tasks Highlighting: Highlights active background tasks in bold cyan to grab the user's attention.
  3. Aesthetics & Opacity Adaptability:

    • Native Opacity & Text Blending: Removed hardcoded foreground color codes (like \033[97m bright white) for numbers and labels. They now use standard ANSI Bold (\033[1m) and Dim (\033[2m) attributes so they natively inherit the terminal's default foreground color and respect any configured background opacity/transparency.

@google-cla

google-cla Bot commented Jul 18, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@AndrewMason7
AndrewMason7 force-pushed the feature/robust-statusline branch from 18d8100 to d7273dc Compare July 18, 2026 02:22
@DIDOUOUGHA

Copy link
Copy Markdown

we need context status line

@AndrewMason7

Copy link
Copy Markdown
Author

we need context status line

can you please explain more?

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