microsoft / microsoft/monaco-editor
[Bug] Shell code color issue after specific line
Open
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 46.8k
- Forks
- 4.1k
- Avg merge
- 17h 58m
- Merged PRs (30d)
- 1
Description
Reproducible in vscode.dev or in VS Code Desktop?
- Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
Monaco Editor Playground Code
const value = /* set from `myEditor.getModel()`: */ `#!/bin/bash
GIT_REPO=git@github.com:xxx/yyy.git
GIT_HOST= \$(echo "\$GIT_REPO" | sed -E 's/^.*@([^:/]+).*\$/\\1/')
DIR_NAME=\$(basename "\$GIT_REPO" .git)
cd /app/\${DIR_NAME}
git pull
pnpm install
rm -rf packages/e2e/test-results`;
// Hover on each property to see its docs!
const myEditor = monaco.editor.create(document.getElementById("container"), {
value,
language: "shell",
automaticLayout: true,
});
Reproduction Steps
open reproduction link in the monaco editor playground
Actual (Problematic) Behavior
after GIT_HOST= $(echo "$GIT_REPO" | sed -E 's/^.*@([^:/]+).*$/\1/')
code color is not correct
Expected Behavior
show code color correctly
Additional Context
work as expected on vscode.dev
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked Monaco Editor Playground reproduction and inspect the shell code around the GIT_HOST assignment, especially the command substitution and sed expression. Compare the incorrect coloring with the expected screenshot and verify the same example renders correctly after the change; the issue does not name a source file or test to run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- shell, typescript
- Domain
- developer-experience, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 62/100