Skip to content

--images is not gated on stdout being a TTY #93

Description

@llimllib

image_protocol is only consulted inside the use_color branch of run() (src/main.rs:310-322), and use_color is true whenever --color=always is passed regardless of whether stdout is a terminal. So:

mdriver --color=always --images kitty README.md > out.md

writes megabytes of base64-encoded kitty escape sequences into the output file.

Image rendering should require io::stdout().is_terminal() independently of the color decision — colors are still meaningful when piped (that's the point of --color=always | less -R), but graphics protocol escapes never are.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions