pygments / pygments/pygments

terminal256/16m adds extra line to output

Open
#1,435 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.2k
Forks
885
PR merge metrics
No merged PRs in 30d

Description

  1. Create an empty file (e.g. empty.c)
  2. pygmentize -f 16m -O style=pastie -o '.\empty.c.ans' '.\empty.c'

Result: empty.c.ans is not an empty file; it has one \n in it.

  1. Create an empty file (e.g. empty.c)
  2. pygmentize -f 16m -O style=pastie -o '.\empty.c.ans' '.\empty.c'

This extends to files with actually content. E.g. a file with a single line:

// hello

Will result in:

// hello
 

This is not what I'd expect.

Contributor guide

No contributing guide indexed for this repository

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 by reproducing the pygmentize -f 16m command with an empty file and a single-line file, then trace the terminal256/16m output path. Compare the generated .ans output with the input and verify that empty input stays empty and non-empty input does not gain an extra line.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.