Shell ! command does not honour my local aliases #2880

Closed
opened 2026-02-16 17:37:40 -05:00 by yindo · 1 comment
Owner

Originally created by @madflow on GitHub (Nov 15, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

So... I think that this used to work...

My local aliases do not work anymore when using ! command in opencode.

frosch ➜ /tmp which g
g: aliased to git
Image
  • MacOs
  • ZSH
  • oh-my-zsh
  • Sourcing aliases from zshrc like this:
ZSH_CUSTOM=~/.config/zsh

OpenCode version

1.0.61

Steps to reproduce

  • See above

Screenshot and/or share link

  • See above

Operating System

  • MacOs latest

Terminal

  • Ghostty
  • Zsh
Originally created by @madflow on GitHub (Nov 15, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description So... I think that this used to work... My local aliases do not work anymore when using `! command` in opencode. ``` frosch ➜ /tmp which g g: aliased to git ``` <img width="847" height="410" alt="Image" src="https://github.com/user-attachments/assets/56beb8ae-824f-4adc-905e-906d5fb02dea" /> * MacOs * ZSH * oh-my-zsh * Sourcing aliases from zshrc like this: ``` ZSH_CUSTOM=~/.config/zsh ``` ### OpenCode version 1.0.61 ### Steps to reproduce * See above ### Screenshot and/or share link * See above ### Operating System * MacOs latest ### Terminal * Ghostty * Zsh
yindo added the bug label 2026-02-16 17:37:40 -05:00
yindo closed this issue 2026-02-16 17:37:40 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 15, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #3479: Both issues are related to shell command execution not using the user's actual shell environment (zsh/bash) with their custom configurations like aliases. Issue #3479 identifies the root cause - OpenCode uses '/bin/sh' instead of the user's $SHELL environment, which doesn't load .zshrc/.bashrc files where aliases are defined.

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 15, 2025): This issue might be a duplicate of existing issues. Please check: - #3479: Both issues are related to shell command execution not using the user's actual shell environment (zsh/bash) with their custom configurations like aliases. Issue #3479 identifies the root cause - OpenCode uses '/bin/sh' instead of the user's $SHELL environment, which doesn't load .zshrc/.bashrc files where aliases are defined. Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2880