Bug Report – Shell script code blocks are corrupted in output
Subject: Bug Report – Shell script code blocks are corrupted in output
Description:
When generating code blocks containing shell scripts (e.g. Bash), the output often corrupts certain characters. Specifically, characters like dollar signs ($), parentheses (( and )), and quotation marks (") are either swallowed, replaced, or garbled in the displayed code.
Example:
The intended line:
TARGET_DIR=$(dirname "$1")
is displayed as:
TARGET_DIR=(dirname"(dirname "(dirname"1")
Similarly, lines containing $(realpath --relative-to="$TARGET_DIR" "$f") or variable expansion like OUTFILE="${TARGET_DIR}/${FILENAME}.zip" are often corrupted in the same way.
Impact:
Copying the displayed code directly into a file results in syntax errors and broken scripts. The corruption seems to occur mainly in longer code blocks, especially when the code contains nested quotes, variable expansions, or command substitution.
Expected behavior:
The code block should be rendered exactly as intended, preserving all special characters ($, (, ), ", etc.) so that it can be copied and used without manual correction.
Environment:
Platform: Web interface (browser-based chat)
Model: DeepSeek (current version at time of writing - DeepSeek-V4)Source: deepseek-ai/DeepSeek-Coder