瀏覽代碼

fix: enable shell alias expansion in ! command (#5621)

Fran Zekan 4 月之前
父節點
當前提交
c2944024a8
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      packages/opencode/src/session/prompt.ts

+ 3 - 2
packages/opencode/src/session/prompt.ts

@@ -1097,7 +1097,7 @@ export namespace SessionPrompt {
           `
             [[ -f ~/.zshenv ]] && source ~/.zshenv >/dev/null 2>&1 || true
             [[ -f "\${ZDOTDIR:-$HOME}/.zshrc" ]] && source "\${ZDOTDIR:-$HOME}/.zshrc" >/dev/null 2>&1 || true
-            ${input.command}
+            eval ${JSON.stringify(input.command)}
           `,
         ],
       },
@@ -1106,8 +1106,9 @@ export namespace SessionPrompt {
           "-c",
           "-l",
           `
+            shopt -s expand_aliases
             [[ -f ~/.bashrc ]] && source ~/.bashrc >/dev/null 2>&1 || true
-            ${input.command}
+            eval ${JSON.stringify(input.command)}
           `,
         ],
       },