I’m not sure if this is a bug or intended behaviour, but when i’m looking through working tree changes in a file to check changes, if i add to the chat window from the file (using ctrl + l) it adds whatever was last selected in a non working tree file.
I’d expect it to either not add anything, or to add what i have selected (as long as the changes in the file had not been staged, or if they have they haven’t been changed since). However, as it does add things and i often don’t notice that what was added is actually from a different file, i keep running into the problem of the context i provide being nonsensical.
Is this a known issue and is there likely any solution coming for it at some point?
Hey, this isn’t a bug in the strict sense, it’s a known limitation of the classic Working Tree diff view, the one you open from the VS Code SCM panel. That diff editor doesn’t pass the active selection to the add-to-chat system, so Ctrl+L picks up the last selection from the normal file editor, which matches what you described.
In the new Diff/SCM view, the Diff tab in Cursor 3.x, selection-based add-to-chat already works. You can select a chunk right in the diff and add it to chat with Ctrl+L. If you open changes from that tab instead of the classic SCM panel, the issue goes away.
Workaround for the classic view is to copy the fragment you need from the diff and paste it into the chat input manually.
We’re not planning a fix specifically for the classic VS Code SCM diff. The team is moving toward having the new Diff view cover these cases. If it doesn’t work for you for some reason, tell me what’s missing and I’ll pass it along.