[FEATURE] Support custom wrapper commands (like shell functions/aliases) for terminal_cmd
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start at the plugin's terminal_cmd handling and reproduce the reported exit code 127 with the example cl shell function. Determine how command execution currently treats PATH executables, then verify that a supported wrapper function or alias works without regressing direct executable commands.
Written by the indexing model from the issue text.
Description
Feature Description
Support for using custom wrapper commands (e.g. shell functions or aliases) as terminal_cmd in claudecode.nvim.
Currently, terminal_cmd only works with executables available in the shell PATH. When using a shell function (e.g. cl), it fails with exit code 127.
Use Case
I created a custom shell function cl that wraps claude with additional custom prompts.
I’d like to use this wrapper command with claudecode.nvim so that every request automatically follows my predefined prompt rules.
This would make it easier for users to customize their workflows without modifying the plugin code.
Proposed Solution
Allow terminal_cmd to support shell functions or aliases in addition to executables.
For example, running the command through a shell (e.g. bash -i -c "cl") so that user-defined functions are available.
Alternatives Considered
- Directly using the
claudebinary instead of the wrapper (works, but loses my custom prompt logic). - Writing a separate executable script (
~/bin/cl) instead of a shell function (possible, but less convenient for quick customization).
Additional Context
Error message when attempting to use a shell function as terminal_cmd:
[ClaudeCode] [terminal] [ERROR] Claude exited with code 127.
Check for any errors.
Example config:
{
"coder/claudecode.nvim",
dependencies = { "folke/snacks.nvim" },
opts = {
terminal_cmd = "cl",
terminal = {
snacks_win_opts = {
...
},
},
},
}
- Dominant language
- Lua
- Stars
- 3.1k
- Forks
- 219
- PR merge metrics
- No merged PRs in 30d
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- No contributing 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.
More from coder/claudecode.nvim
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
coder/claudecode.nvim#321 ·
-
bug needs-triage
Difficulty 1/5 Under an hour Newbie friendliness 88/100
coder/claudecode.nvim#314 ·
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
coder/claudecode.nvim#313 ·
-
needs-triage
Difficulty 5/5 Over a week Newbie friendliness 20/100
coder/claudecode.nvim#319 · 2 reactions ·
-
[BUG] 框选文本一直抱错误信息Openbug needs-triage
Difficulty 4/5 3-5 days Newbie friendliness 35/100
coder/claudecode.nvim#316 · 1 comment ·
All issues in coder/claudecode.nvim
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
AstroNvim/astrotheme#184 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
objectionary/eolang.sty#184 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
feature request
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Maintainers usually reply within 2 days