starship/starship
Bug report
starship bug-report is a self-service tool for filing GitHub issues with relevant environment information. It lives in src/bug_report.rs and is one of the few subcommands that prompts the user interactively.
What it does
- Collects the current environment:
- OS: type and version via
os_info::get(). - Shell: detected from
$STARSHIP_SHELL/ parent process / fallback heuristics. Includes the shell's version (best effort) by running its--versionflag. - Terminal: detected from
$TERM_PROGRAM,$TERM, parent process, etc. - Starship config: reads the user's
starship.toml(without env-var expansion, so secrets in env vars don't leak). - Starship version:
shadow::VERSIONplusshadow::TAG/shadow::BRANCHto indicate whether the build is from a tag or a feature branch.
- OS: type and version via
- Renders a Markdown bug-report body with these fields pre-populated.
- Prints the body to stdout and asks the user to confirm with
y\nwhether to open the issue in their browser. - If yes: builds a
https://github.com/starship/starship/issues/new?body=...URL withurlencoding::encodeand opens it via theopencrate. The body is truncated at the GitHub character limit (8100). - If no: prints the report and asks the user to copy/paste manually.
Privacy considerations
The report includes the literal contents of starship.toml. The bug-report flow explicitly warns the user before opening the browser:
Warning: To avoid any sensitive data from being exposed, please review the included information before proceeding.
Environment variables, shell history, and command output are never collected. The shell version detection runs each shell's --version only, which historically does not contain user data.
Implementation notes
get_pkg_branch_tag()returnsshadow::TAGif non-empty, elseshadow::BRANCH. This is what tells maintainers whether the bug is on a release or onmain(or a fork branch).get_starship_config()returns<unknown config>if the file cannot be read.- The "Forward the pre-filled report above to GitHub in your browser?" prompt is one of only two interactive read-from-stdin paths in the binary (the other being
starship configopening the user's editor).
Entry points for modification
- Add a new field to the report: extend the
Environmentstruct and the correspondingget_*helper, then updateget_github_issue_body. - Change the issue URL: edit
make_github_issue_link. - Change the truncation limit: edit
GITHUB_CHAR_LIMIT(currently8100).
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.