charmbracelet / charmbracelet/glow

config file not respected

Open
#752 1 comment 7 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
27.4k
Forks
764
Avg merge
3m
Merged PRs (30d)
1

Description

**Describe the bug**
i have my configs saved in the default location of `~/.config/glow/glow.yml`, but all of my directives are ignored by glow, in contrast to when it is specify via command arguments (for example, `-w`/`--width` instead of `width: [...]`)

**Setup**
- version: `2.1.0`
- system: `"x86_64-linux"`
- host os: `Linux 6.14.2, NixOS, 25.05 (Warbler), 25.05.20250417.b024ced`

**Additional context**

`glow help`

```console
Render markdown on the CLI, with pizzazz!

Usage:
glow [SOURCE|DIR] [flags]
glow [command]

Available Commands:
completion Generate the autocompletion script for the specified shell
config Edit the glow config file
help Help about any command

Flags:
-a, --all show system files and directories (TUI-mode only)
--config string config file (default /home/usercccp/.config/glow/glow.yml)
-h, --help help for glow
-l, --line-numbers show line numbers (TUI-mode only)
-p, --pager display with pager
-n, --preserve-new-lines preserve newlines in the output
-s, --style string style name or JSON path (default "auto")
-t, --tui display with tui
-v, --version version for glow
-w, --width uint word-wrap at width (set to 0 to disable)

Use "glow [command] --help" for more information about a command.
```

`~/.config/glow/glow.yml`

```yaml
line-numbers: true
mouse: true
pager: true
width: 0
```

below is an example of how glow behaves without and with passed arguments

`glow TODO.md` or `glow --config ~/.config/glow/glow.yml TODO.md`

```markdown

# todo list

see here
https://github.com/todomd/todo.
md/blob/0bc8c741496b266e8a3dc7dc1706ab56e3258ecf/TODO.md
for how to structure this file

## in progress

[ ] nixcord
[ ] shell
[ ] check for new nixos-unstable commit
[ ] helper functions for nixos-rebuild
[ ] update commit hash in github blob comments
• [[ "$(nix flake metadata nixpkgs/nixos-unstable --json | jq --raw-
output .revision)" = "$(nixos-version --hash)" ]]
• type -p grep | readlink -f "$( flakeDefault |> lib.map)
[x] prepare firefox-addons-nix
[x] reduce attrNames, genAttrs, let
[x] replace with by inherit
[x] standardise pipes and attrs merges
[x] update username and multiline comment style
[x] batman
[x] add env vars
[x] dotfiles
[x] add configs for ov
[x] remove obsolete dir
[x] kanata
[x] add home row mods
[x] kernel
[x] use latest version
[x] mime
[x] remove addedAssociations and vlc defaults
[x] update structure of defaultApplications
[x] nix-index
[x] replace with nix-index-database
[x] nur
[x] remove from usage
[x] nix-tree
[x] replace defaultPackage
[x] sops
[x] support atuin credentials


## resources

• https://en.wikipedia.org/wiki/ASCII#Character_set https://en.wikipedia.
org/wiki/ASCII#Character_set
• https://home-manager-options.extranix.com/?query=&release=master https://home-
manager-options.extranix.com/?query=&release=master
• https://home-manager.dev/ https://home-manager.dev/
• https://nix.dev/manual/nix/latest/ https://nix.dev/manual/nix/latest/
• https://nixos.org/learn/ https://nixos.org/learn/
• https://nixos.org/manual/nixos/unstable/ https://nixos.
org/manual/nixos/unstable/
• https://nixos.org/manual/nixpkgs/unstable/ https://nixos.
org/manual/nixpkgs/unstable/
• https://noogle.dev/ https://noogle.dev/
• https://nuschtos-search.pages.dev/ https://nuschtos-search.pages.dev/
• https://search.nixos.org/packages?channel=unstable https://search.nixos.
org/packages?channel=unstable
• https://wiki.nixos.org/wiki/NixOS_Wiki https://wiki.nixos.org/wiki/NixOS_Wiki

```

`glow --width 0 TODO.md` or `glow --config ~/.config/glow/glow.yml --width 0 TODO.md`

```markdown

# todo list

see here https://github.com/todomd/todo.md/blob/0bc8c741496b266e8a3dc7dc1706ab56e3258ecf/TODO.md for how to structure this file

## in progress

[ ] nixcord
[ ] shell
[ ] check for new nixos-unstable commit
[ ] helper functions for nixos-rebuild
[ ] update commit hash in github blob comments
• [[ "$(nix flake metadata nixpkgs/nixos-unstable --json | jq --raw-output .revision)" = "$(nixos-version --hash)" ]]
• type -p grep | readlink -f "$( flakeDefault |> lib.map)
[x] prepare firefox-addons-nix
[x] reduce attrNames, genAttrs, let
[x] replace with by inherit
[x] standardise pipes and attrs merges
[x] update username and multiline comment style
[x] batman
[x] add env vars
[x] dotfiles
[x] add configs for ov
[x] remove obsolete dir
[x] kanata
[x] add home row mods
[x] kernel
[x] use latest version
[x] mime
[x] remove addedAssociations and vlc defaults
[x] update structure of defaultApplications
[x] nix-index
[x] replace with nix-index-database
[x] nur
[x] remove from usage
[x] nix-tree
[x] replace defaultPackage
[x] sops
[x] support atuin credentials


## resources

• https://en.wikipedia.org/wiki/ASCII#Character_set https://en.wikipedia.org/wiki/ASCII#Character_set
• https://home-manager-options.extranix.com/?query=&release=master https://home-manager-options.extranix.com/?query=&release=master
• https://home-manager.dev/ https://home-manager.dev/
• https://nix.dev/manual/nix/latest/ https://nix.dev/manual/nix/latest/
• https://nixos.org/learn/ https://nixos.org/learn/
• https://nixos.org/manual/nixos/unstable/ https://nixos.org/manual/nixos/unstable/
• https://nixos.org/manual/nixpkgs/unstable/ https://nixos.org/manual/nixpkgs/unstable/
• https://noogle.dev/ https://noogle.dev/
• https://nuschtos-search.pages.dev/ https://nuschtos-search.pages.dev/
• https://search.nixos.org/packages?channel=unstable https://search.nixos.org/packages?channel=unstable
• https://wiki.nixos.org/wiki/NixOS_Wiki https://wiki.nixos.org/wiki/NixOS_Wiki

```

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the behavior with `glow TODO.md` and with `glow --config ~/.config/glow/glow.yml TODO.md`, then trace how the default `~/.config/glow/glow.yml` is discovered and how `width`, `line-numbers`, `mouse`, and `pager` are applied. Done means directives from the default config affect output the same way as equivalent command-line flags.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.