[FEATURE] Support custom wrapper commands (like shell functions/aliases) for terminal_cmd
- Lenguaje dominante
- Lua
- Estrellas
- 3.1k
- Forks
- 216
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
## 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 `claude` binary 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.
```lua
Example config:
{
"coder/claudecode.nvim",
dependencies = { "folke/snacks.nvim" },
opts = {
terminal_cmd = "cl",
terminal = {
snacks_win_opts = {
...
},
},
},
}
```
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza con el manejo de terminal_cmd del plugin y reproduce el código de salida 127 informado usando la función de shell de ejemplo cl. Determina cómo trata actualmente la ejecución de comandos los ejecutables de PATH y verifica después que una función wrapper o un alias compatibles funcionan sin provocar regresiones en los comandos ejecutables directos.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- bash, lua, neovim, shell
- Área
- cli, devtools
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100