Skip to content

[BUG] [v0.0.7] cortex debug ripgrep install hint shows "apt install ripgrep" without sudo, but --install uses "sudo apt install -y ripgrep" #53124

@kiannidev

Description

@kiannidev

Project

cortex

Description

When ripgrep is not installed, cortex debug ripgrep displays manual install hints. The Linux hint says apt install ripgrep (without sudo). However, the actual --install implementation runs sudo apt install -y ripgrep (with sudo and -y). A user who copies the displayed hint will get a permission error. Conversely, the --install flag silently escalates to sudo without informing the user.

Error Message

Debug Logs

System Information

Ubuntu 24.04

Screenshots

https://github.com/kiannidev/screens/blob/main/53e226a658e22031a734cdbc2cd1787d.png

Steps to Reproduce

When ripgrep is not installed:
Run cortex debug ripgrep

Expected Behavior

The install hint should match the actual install command, e.g. sudo apt install ripgrep.

Actual Behavior

To install ripgrep:
macOS: brew install ripgrep
Linux: apt install ripgrep / dnf install ripgrep
Windows: winget install BurntSushi.ripgrep.MSVC

The hint says apt install ripgrep (no sudo), but the --install code runs sudo apt install -y ripgrep.

Additional Context

Code Location:
src/cortex-cli/src/debug_cmd/handlers/ripgrep.rs:

  • Line 130 (hint): println!(" Linux: apt install ripgrep / dnf install ripgrep");
  • Lines 179–180 (actual): Command::new("sudo").args(["apt", "install", "-y", "ripgrep"])

Metadata

Metadata

Assignees

No one assigned

    Labels

    ideIssues related to IDEvalidValid issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions