fix(tui): treat absolute file paths as plain text, not commands#3554
Merged
jeremymcs merged 1 commit intogsd-build:mainfrom Apr 7, 2026
Merged
fix(tui): treat absolute file paths as plain text, not commands#3554jeremymcs merged 1 commit intogsd-build:mainfrom
jeremymcs merged 1 commit intogsd-build:mainfrom
Conversation
Contributor
🟠 PR Risk Report — HIGH
Affected Systems
File Breakdown
|
|
Nice |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR
What: Dragging a file into Pi no longer triggers "Unknown command" errors.
Why: Absolute paths like
/Users/name/file.pngwere parsed as/Usersslash command.How: Detect file paths (contain
/after position 0) and bypass slash command dispatch.What
When a file is dragged into the Pi TUI input field, the absolute path (e.g.,
/Users/name/Desktop/screenshot.png) starts with/and is interpreted as a slash command. This showsError: Unknown command: /Users/name/Desktop/screenshot.png.The fix adds a
looksLikeFilePath()heuristic before the slash command check: if the first token contains a/after position 0 (like/Users/name/...), it's a file path, not a command. Slash commands are single tokens like/helpor/gsd— they never contain embedded slashes.Why
How
input-controller.ts: AddedlooksLikeFilePath()guard beforetext.startsWith("/")command dispatch/at position >0 → file path, not commandsession.prompt()as normal user inputChange type
Test plan
/Users/name/Desktop/screenshot.pngsent as plain input (new test)/home/user/documents/file.txtsent as plain input (new test)/tmp/some-file.logsent as plain input (new test)/settingsstill dispatched as slash command (existing test)/gsd helpstill dispatched as slash command (existing test)Closes #3478
🤖 Generated with Claude Code