feat: add -f/--follow to render appended content like tail -f - #992
Open
DanCard wants to merge 1 commit into
Open
feat: add -f/--follow to render appended content like tail -f#992DanCard wants to merge 1 commit into
DanCard wants to merge 1 commit into
Conversation
Follow a local markdown file and render newly appended content to stdout as it arrives, without repainting, so scrollback and piping keep working. - watch the parent directory via fsnotify (survives atomic saves), debounce write bursts, and read only appended bytes - flush at block-safe boundaries: the last blank line outside a fenced code block, with CommonMark-aware fence tracking - flush a trailing unterminated block after an 8s idle timeout, re-opening a split code fence in the next chunk - on truncation or rewrite, print a divider and re-render the file - render non-markdown files per complete line as wrapped code blocks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
glow -f file.mdrenders the file, then appends newly written content to stdout as the file grows —tail -ffor markdown. Output is append-only (never repaints), so scrollback survives and piping works.How
tail -f, a shrunken or replaced file gets a rendered---divider and a full re-render below prior output.--followrequires exactly one local file; stdin, URLs, directories, and combining with--pager/--tuiproduce clear errors. fsnotify was already a dependency.Testing
go build,go vet,go test ./..., andgolangci-lint runclean for the new code.Known limitations
🤖 Generated with Claude Code
https://claude.ai/code/session_0115ibTkoRG9o6Brf1reA1Jj