Skip to content

fix: expand shell variables in bash argPath for permission check (#740), allow leader keybinds when prompt focused (#674)#796

Open
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-bash-path-perm-keybind
Open

fix: expand shell variables in bash argPath for permission check (#740), allow leader keybinds when prompt focused (#674)#796
MrRealORG wants to merge 1 commit into
XiaomiMiMo:mainfrom
MrRealORG:fix/auto-0616-bash-path-perm-keybind

Conversation

@MrRealORG

Copy link
Copy Markdown

Summary

Two targeted safety fixes in 2 files:

Fix #740 — Bash tool skips external directory permission for shell-variable paths

The argPath() function in bash.ts only called expand() (which resolves $HOME, $PWD etc.) for PowerShell. On bash, it only called home(unquote(arg)) which handles ~ but not $HOME.

Since the unexpanded text still contained $, dynamic() returned true, causing the entire external directory permission check to be skipped. This meant commands like rm -rf $HOME/project never triggered the directory permission prompt.

Fix: Call expand() for all shells, not just PowerShell. The function already handles both PowerShell ($env:X, ${env:X}) and bash ($HOME, $PWD) patterns.

Fix #674 — Leader-prefixed keybinds blocked when prompt is focused

In dialog-command.tsx, the keyboard handler skips non-input keybinds when the text input is focused and the pressed key matches a text-editing key (like Down arrow). Leader-prefixed keybinds like <leader>down (Ctrl+X → Down) were caught by this guard because the Down key matches input_move_down.

Fix: Add an exception for <leader>-prefixed keybinds so multi-key chords work while the prompt is focused.

Test Plan

  • On bash, run a command targeting $HOME/some-path — should trigger external directory permission prompt
  • With prompt focused, press Ctrl+X then Down — should navigate to subagent session

…rmission check (XiaomiMiMo#740), allow leader keybinds when prompt is focused (XiaomiMiMo#674)

- Bash tool: argPath() now calls expand() for all shells (not just
  PowerShell), so paths like $HOME/dir are resolved before the
  external-directory permission check. Previously on bash, $HOME
  was left unexpanded, causing dynamic() to return true and skip
  the safety check entirely.

- Command palette: leader-prefixed keybinds (e.g. <leader>down) are
  no longer blocked when the text input is focused. The text-editing
  key guard now exempts <leader> bindings so multi-key chords work
  while typing in the prompt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

误删文件,我的E盘被清空了包含MIMO的目录 Subagents are not clickable

1 participant