You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Color heredocs in bash commands in their own language #54701
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.
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.
Activity
opencode-agent commentedon Oct 12, 2026
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: