Skip to content

recover.rs uses std eprintln instead of anstream eprintln #1182

Closed

Description

@worktrunk-bot

Problem

src/git/recover.rs (added in e40ed3a, #1146) uses the standard library's eprintln! macro instead of the project's crate::styling::eprintln (re-exported from anstream).

The rest of the codebase consistently uses the anstream-backed eprintln to ensure ANSI escape codes are stripped when stderr is not a terminal. The info_message() function returns a FormattedMessage containing ANSI codes (via cstr!("<dim>○</>")), so printing it with std::eprintln! would emit raw escape sequences when stderr is piped.

Location: src/git/recover.rs:23-26

Fix

Add use crate::styling::eprintln; to the imports in recover.rs. This shadows the standard eprintln! macro with the anstream version, matching the pattern used in every other file that prints styled messages.

Impact

Minor — the recovery path only triggers in interactive scenarios (deleted CWD), so piped output is unlikely. But the inconsistency should be fixed to prevent copy-paste propagation.

Activity

  1. added
    nightly-cleanup
    on Feb 23, 2026
  2. added a commit that references this issue on Feb 23, 2026
    f5ec190
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

    nightly-cleanup

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions