[BUG] Clicking a link to a folder selects it in its parent instead of opening it (Windows: explorer /select,)

Open
#110,636 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
57/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
typescript
Domain
desktop, devtools

Research direction

The issue identifies the click dispatcher and its Windows, macOS, and Linux branches from the Claude Code 2.1.326 binary, but names no source file or test. Start by locating the dispatcher and checking how it distinguishes files from folders on each platform. Done means folder links open the folder and file links still reveal the file; add coverage for both behaviors.

Written by the indexing model from the issue text.

Description

area:tui bug platform:windows

Environment. Claude Code 2.1.326, native install, Windows 11, Windows Terminal, full-screen views.

What happens. Clicking a file: link to a folder in a reply does not open that folder. File Explorer opens its parent with the folder selected, so it takes another double-click to get in. Going by the code below, the macOS (open -R) and Linux (FileManager1.ShowItems) branches reveal a folder the same way; I have only run the Windows one.

Why. The click dispatcher reveals every file: link and never checks whether the path is a folder. From the 2.1.326 binary:

if(r==="macos")return{command:"open",args:["-R","--",e]};
if(r==="windows")return{command:"explorer",args:[`/select,${e}`]};
return{command:"dbus-send",args:[/* ... */"org.freedesktop.FileManager1.ShowItems",`array:string:${g(e).href}`,"string:"]}

explorer /select,<folder> always shows the parent. I tried the forms a link could produce (<folder>, <folder>\, <folder>\., a trailing comma, a wildcard): each opens the parent with the folder selected, or Desktop when the path does not resolve.

Repro.

  1. Ask Claude to name a folder by its absolute path, such as C:\Users\me\Documents.
  2. Click the path in the reply.
  3. File Explorer opens C:\Users\me with Documents selected, not C:\Users\me\Documents.

A workaround that misleads. Pointing the link at an entry inside the folder makes /select, open the folder itself. But Explorer then selects that entry, and with the preview pane on, an image there fills the pane, so the click looks like it opened the image rather than the folder.

Expected. A link to a folder opens the folder: explorer <folder> on Windows, open -- <folder> on macOS, FileManager1.ShowFolders on Linux. Links to files can keep revealing.

Related: #105228 (the /select, window starts hidden on Windows), #82078 (Linux opens the file twice).

Dominant language
TypeScript
Stars
156k
Forks
25k
Avg merge
16h 19m
Merged PRs (30d)
5

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anthropics/claude-code

All issues in anthropics/claude-code

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.