[go: up one dir, main page]

Skip to content

Markdown rendering doesn't work on light terminal backgrounds

  • I'm using the latest version of the extension (Run glab --version)
    • Extension version: Put your extension version here
  • Operating system and version: Put your version here
  • Gitlab.com or self-managed instance? gitlab.com/self-managed instance/both
  • GitLab version (if self-managed) GitLab version here (Use the version endpoint, like this: gitlab.my-company.com/api/v4/version)
  • I have performed glab auth status to check for authentication issues
  • Run the command in debug mode (like DEBUG=true glab mr list) and attach any useful output

Summary

Markdown rendering, for example view issue, or view MR, theme doesn't work on light terminal backgrounds.

We should use termenv.HasDarkBackground() to automatically set the theme if the user hasn't specified it.

Environment

  • OS: Darwin 24.3.0 arm64
  • SHELL: /bin/zsh
  • TERM: xterm-256color
  • GLAB: Current glab version: 1.53.0 (2025-02-11)%

Other:

Steps to reproduce

  1. Set your terminal to a light theme.
  2. Remove all glab theme env variables.
  3. View an issue / mr description glab mr view

What is the current bug behavior?

Light text on a light background

What is the expected correct behavior?

Dark text on a light background

Relevant logs and/or screenshots

Screenshot 2025-03-07 at 14.21.14.png

Possible fixes

Add detection to the RenderMarkdown function

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information