Skip to content

Suggest powershell syntax for setting RUST_BACKTRACE in the panic result on Windows #98379

Open
@kaleidawave

Description

@kaleidawave

Currently on Windows when a program panics and the default panic handler is run one of the lines it prints is: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

The problem is this is not the syntax that powershell (which I think is the default and largest shell used on Windows) uses to set environment variables.

I think note: `RUST_BACKTRACE=1` (or PowerShell `$env:RUST_BACKTRACE=1`) environment variable to display a backtrace would be more correct and better for beginners.

Should be pretty simple change adding a different cfg! branch for following code

if print_fmt == PrintFmt::Short {
writeln!(
fmt,
"note: Some details are omitted, \
run with `RUST_BACKTRACE=full` for a verbose backtrace."
)?;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-backtraceArea: BacktracesC-enhancementCategory: An issue proposing an enhancement or a PR with one.O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions