Преглед изворни кода

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

Fran Zekan пре 2 месеци
родитељ
комит
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)}
           `,
         ],
       },