Skip to content

[FEATURE]: Color heredocs in bash commands in their own language #54701

Open

Description

@Nowaker

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

A heredoc in a bash command is usually a whole program: Python fed to python3 - <<'PY', SQL to psql, a TypeScript file written with cat > x.ts <<'EOF'. In my sessions about 5% of bash calls carry one, averaging 20-40 lines. Colored as bash, the whole body is one string.

tree-sitter-bash marks the body but says nothing about its language, so it has to come from the command that reads it: python3 means Python, psql SQL, cat > x.ts the file's extension, a #! line as a fallback. An unknown consumer should keep the plain string color rather than guess.

This is AI generated, but under direct supervision and on request of @Nowaker.

Activity

  1. opencode-agent commented on Oct 12, 2026

    @opencode-agent
    Contributor

    Thanks for the suggestion, @Nowaker! You're asking for the body of a heredoc in a shell command to be highlighted in its own language. The language would be taken from the command that reads it (python3 → Python, psql → SQL, cat > x.ts → TypeScript, then a #! line as a fallback), and unknown readers would keep the plain string color.

    One thing to know: the current v2 TUI shows shell tool commands as plain text, with no bash highlighting yet. So this would build on adding bash highlighting first.

    A plugin can't do this today, because the TUI plugin API has no way to change how a tool call is rendered or to add syntax-highlighting rules. The maintainers will consider the request.

    Related:

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions