Skip to content

docs: no # comment at the end of a shell line (zsh does not treat it as a comment) #92

Closed

Description

@groupsky

Some shell blocks in the docs end a command line with a # comment. Interactive zsh does not treat # as the start of a comment unless the option interactivecomments is on, and it is off by default. So a reader who pastes such a line into zsh passes the # and the words after it to the command as arguments.

For example, read -rs TOKEN # paste the token, ... makes zsh's read try to set variables named #, paste, the and so on. VERSION=0.1.0 # the new version does not set VERSION at all.

Lines seen on 2026-10-17 (on main at f6e47bb):

Comments in TOML blocks are fine: they are config, not shell.

Done when

  • No shell block in README.md, AGENTS.md or docs/ has a command line that ends in a # comment. A note goes on its own line above the command, or into the text.
  • A short check finds none (for example a test that reads the shell blocks of these files, or a script in CI).

Activity

  1. groupsky commented on Nov 9, 2026

    @groupsky
    ContributorAuthor

    Done in #164 (squash commit 146b7f8).

    • No shell block in README.md, AGENTS.md or docs/ has a command line that ends in a # comment: 19 lines in README.md, AGENTS.md, docs/setup.md, docs/manual-telegram-test.md and docs/manual-ntfy-test.md now have the note on its own line above the command.
    • A short check finds none: docs_test.go at the root of the module. TestDocsShellLinesHaveNoTrailingComment reads the sh/bash/shell/zsh/console blocks of every Markdown file at the root and in docs/, and runs in CI with go test ./.... TestTrailingShellComments checks the finder (quotes, $#, URLs with #, TOML and indented blocks). CI was green on docs: put shell notes on their own line, not after the command #164.
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

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions