deepseek-ai / deepseek-ai/DeepSeek-Coder
Bug Report – Shell script code blocks are corrupted in output
- Dominant language
- Python
- Stars
- 24.3k
- Forks
- 2.9k
- PR merge metrics
- No merged PRs in 30d
Description
### 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)
Contributor guide
No contributing guide indexed for this repository
Research direction
No source file, test, or entry point is named. Start by reproducing the issue in the web interface with the exact shell examples and compare the generated, displayed, and copied text; done means special characters remain unchanged in code blocks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- bash
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100