Back Home

GitHub Repo

Hermes Agent Fixes Terminal Drag-and-Drop Path Handling; Community Adds Tests Across Four Shells

On October 28, the Hermes Agent community reported tests of the terminal file drag-and-drop fix: all four shells passed the test paths intact. The fix has been merged into the main branch; paths it cannot handle reliably are now rejected with a warning.

Gerald L. Nino · Public domain · Image source
zh-Hant

Hermes Agent’s terminal drag-and-drop fix has received new real-world testing. On October 28, contributors reported in the browser Webapp that, across zsh, fish, tcsh, and PowerShell, all 27 tested file paths were passed to program arguments unchanged, with none of the test command injections occurring. Fix PR #144719 was merged into the main branch on the 26th, and maintainers confirmed the related work was complete on the 27th. Test results and maintainer confirmation

The problem lay in how file paths were converted into terminal input. Previously, when the program encountered an unrecognized shell, it applied POSIX single-quote rules. But nu, xonsh, and elvish each have their own syntax, so specially crafted filenames could escape the intended quoting boundaries. The PR discussion records reproductions in nu and elvish: a user could drag in a specially crafted filename and press Enter to execute additional commands. Windows cmd had a separate issue: when delayed expansion was enabled, an exclamation mark inside double quotes could still alter the path. Fix and reproduction details

The new version selects rules based on the shell’s executable name, avoiding false detection when a directory name contains “cmd.” For shells that are not explicitly supported, it only enters simple paths that meet the restrictions; paths with complex content such as spaces or quotes are skipped with a warning. Paths containing exclamation marks are also rejected under cmd. Because the quoting function is shared, custom shells in the native Desktop app and SSH tabs are affected as well. Implementation details

These differences cannot be handled by simply adding quotes uniformly. For example, the official fish documentation specifies that variables are not expanded inside single quotes, but certain backslash escape rules still apply; inside double quotes, variables and some command substitutions are still allowed. For agent tools that provide a terminal interface, handling paths before they enter the shell is an input boundary worth checking separately. fish quoting rules

The available evidence still has limitations: testing on the 28th was run on macOS and did not cover cmd, Windows PowerShell, or SSH tabs, and this article did not independently rerun the tests. Deployers should next confirm that their version includes merged commit 72e47c1 and check whether their shell produces new path rejection warnings in actual use; a merge into the main branch does not mean every release package has been updated. Testing limitations

Sources

  1. Hermes Agent #144704:維護者完成確認與 10 月 28 日實測
  2. Hermes Agent PR #144719:終端重繪、退出與拖放路徑引用修補
  3. fish 官方文件:引號與跳脫規則