Skip to content

focus enable prints its idempotent success message to stderr #44

Description

@PeGa

What happens

lib/enable.sh:10-13:

if ! is_focus_disabled; then
    echo "✅ Refocus is already enabled." >&2
    exit 0
fi

Enabling when already enabled is a success — CONV-IDEMPOTENT-ENABLE calls it "a no-op that says so", and the exit code is 0 — but the message goes to stderr.

$ focus enable > /dev/null
✅ Refocus is already enabled.      # still on the terminal

$ focus enable 2>/dev/null
                                    # silent success

Why it's needed

Every other in the codebase goes to stdout; stderr is used for and . A caller redirecting stderr to drop warnings silently loses a normal status line, and one capturing stdout gets nothing.

Small, but it is the only place where success is routed as if it were an error.

Suggested fix

Drop the >&2. Exit code stays 0.

Location

lib/enable.sh:11

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions