Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Markup Not Working in Azure Pipelines #1666

Open
elzik opened this issue Oct 16, 2024 · 1 comment
Open

Markup Not Working in Azure Pipelines #1666

elzik opened this issue Oct 16, 2024 · 1 comment
Labels
bug Something isn't working needs triage

Comments

@elzik
Copy link

elzik commented Oct 16, 2024

Information

  • OS: Linux Ubuntu 22.04.5 build agent
  • Version: Spectre.Console 0.49.1
  • Terminal: Azure pipeline output

Describe the bug
When a console app built using Spectre.Console is run from an Azure pipeline PowerShell task, the output does not honour the colours set.

To Reproduce

  1. Create a simple .NET console application and reference Spectre.Console
  2. Execute this single line in the console application:
AnsiConsole.MarkupLine("[green]This should be green but isn't[/]");
  1. Run the console application from a PowerShell@2:
- task: PowerShell@2
  displayName: 'Test Script'
  inputs:
    targetType: 'inline'
    script: |
      Write-Host "`e[32mThis should be green and is`e[0m"
      test-console-application

Expected behavior
Both lines written to the console should be green. The first is using an ANSI escape code, and the second is using Spectre.Console. However, as seen in the screenshot, only the first line is green.

Screenshots
image


Please upvote 👍 this issue if you are interested in it.

@elzik elzik added bug Something isn't working needs triage labels Oct 16, 2024
@patriksvensson
Copy link
Contributor

Spectre.Console is probably not detecting ANSI support from the environment it runs in. This could happen if stdout is redirected for example. This could be solved by adding an enricher for Azure Pipelines just as we have for other CI-servers such as GitHub Actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs triage
Projects
Status: Todo 🕑
Development

No branches or pull requests

2 participants