coder / coder/claudecode.nvim

[FEATURE] Support custom wrapper commands (like shell functions/aliases) for terminal_cmd

Aperta
#135 0 commenti 1 reazione 0 assegnatari Vedi su GitHub
Lingua principale
Lua
Stelle
3.1k
Fork
216
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

## 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 = {
...
},
},
},
}

```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
bash, lua, neovim, shell
Ambito
cli, devtools
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.