microsoft / microsoft/winget-cli

Winget --version to show correct variable and / or rendered link to log

Open
#1,977 5 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Output Issue-Feature
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Description of the new feature / enhancement

Basic idea:
winget should detect if it is executed in cmd or PowerShell, and change the output of the log path accordingly to use the common variable to localappdata, which is $env:localappdata in PowerShell, and %localappdata% in cmd.

Based on feedback, it would be most feasible to follow this approach which should ease the whole process and remove the idea to determine the variable name based on cmd or PowerShell.

Extended idea:
When Winget detects it is run in Windows Terminal it should render the path to the logs, so it can be opened simply by ctrl+left mouse click in Windows Terminal and open it in File Explorer
(this might need remote work of the Windows Terminal team)
Currently only https seems to handled, no local paths.
fyi @DHowett

Just in case rendering the link and determination is too complicated or not worth the time, I would like to fall back to the basic idea that "winget --info" when run in a PowerShell session should show the logs folder as $env:localappdata, so a user can directly copy the path and change to this folder in the shell.

Proposed technical implementation details

Winget shall detect if it is running in Windows Terminal (if possible)
Winget shall detect if it is running in PowerShell or cmd session

Winget --info shall output the link to logs as a rendered link (Windows Terminal would do this in the correct format)

Examples:
Winget run in native shell as cmd or PowerShell 5.x / 7.x
current behaviour:
Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

Winget run in Windows Terminal (e. g. Windows 11 default shell) as cmd
Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

Winget run in Windows Terminal (e. g. Windows 11 default shell) PowerShell 5.x / 7.x
$env:localappdata\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

Use case:
improved accessibility to logs based on user's preferred shell.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the implementation of the winget --info entry point and the code that formats the log path. Read the linked discussion to resolve whether shell-specific variables or Windows Terminal links are in scope. Done means the selected approach displays an accessible log path for the supported shell or terminal contexts, with winget --info output matching the documented examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, powershell
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.