Unhandled Promise Rejection: Bad substitution: chunks[1].startOffset
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- bash, node.js
- Domain
- cli
Research direction
Start with the command-parsing path that invokes shell-quote, then inspect the parse.js locations in the stack trace and the surrounding promise error handling. Identify an input that triggers the substitution failure and verify that the command either runs or produces a handled, clear validation error instead of an unhandled rejection.
Written by the indexing model from the issue text.
Description
Summary
Command Code crashes with an unhandled promise rejection when parsing a shell command.
Environment:
- OS: Ubuntu Linux
- Node.js: v22.20.0
- Command Code: latest installed version
- Shell: [bash/zsh/etc.]
Error:
CRITICAL: Unhandled Promise Rejection!
This is an unexpected error. Please file a bug report.
ERROR: Error
REASON → Bad substitution: chunks[1].startOffset
Stack trace:
Error: Bad substitution: chunks[1].startOffset
at parseEnvVar (.../command-code/node_modules/shell-quote/parse.js:171:12)
at .../command-code/node_modules/shell-quote/parse.js:256:17
at Array.map ()
at parseInternal (.../command-code/node_modules/shell-quote/parse.js:113:17)
at parse (.../command-code/node_modules/shell-quote/parse.js:309:15)
...
Trace ID:
c58b9fbd1d12acef3534f9db896e4142
The error appears to originate while parsing the shell command/environment
variable substitution through the shell-quote dependency.
Expected Behavior
The command should either execute normally or return a handled/clear
validation error rather than crashing with an unhandled promise rejection.
Actual Behavior
The command should either execute normally.
Steps to reproduce the issue
The issue doesn’t require reproduction.
Command Code Version
1.53.0
Operating System
Linux
Terminal/IDE
Terminal
Shell
bash
Session file (optional)
No response
Fix prompt (optional)
No response
Additional context
This was reproduced on Ubuntu with Node.js v22.20.0.
- Dominant language
- No language data
- Stars
- 4k
- Forks
- 350
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
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.
More from CommandCodeAI/command-code
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CommandCodeAI/command-code#903 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CommandCodeAI/command-code#855 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
CommandCodeAI/command-code#841 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CommandCodeAI/command-code#655 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CommandCodeAI/command-code#608 ·
All issues in CommandCodeAI/command-code
Similar issues
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
app bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
kovidgoyal/kitty#10516 ·