Drag-and-Drop non-image Files
What version of the VS Code extension are you using?
0.4.1
Which IDE are you using?
Vs code
What platform is your computer?
Microsoft Windows NT 10.0.26100.0 x64
What steps can reproduce the bug?
I would like the developers to add two features to make working with Codex in VS Code faster and more convenient.
First, allow users to drag and drop a file or an entire folder from the Explorer into the chat window. When dropped, the file/folder content should automatically be sent as context and clearly displayed in the chat window so users know what has been attached. This eliminates the need to click the “+” button and manually select or copy-paste files each time, saving many repetitive steps.
Second, when a user highlights a piece of code in the editor, that selected code should be treated as the default context in the chat. The AI will then focus its analysis or answers on the highlighted section.
What is the expected behavior?
_No response_
What do you see instead?
_No response_
Additional information
_No response_
22 Comments
+1
That context is automatically included if you click the "Auto context" button
You can also right click code (or a selection) and choose "Add to Codex chat" and it will do what you're looking for. You can also bind it to a hotkey
<img width="598" height="168" alt="Image" src="https://github.com/user-attachments/assets/fbe29938-76c6-48a2-957d-333da49560e6" />
I'll leave this open to track dragging folders and at-mentioning folders (which is something we want to fix soon).
yes! please support to drag any file directly to the chat. some times , my file is in other folder not the open folder inside vscode.
PS: just copy what roo code is done.
This. moving from cursor to codex and this seems like an obvious feature.
If a dev chooses IDE over CLI that means using the mouse
Why close the issue https://github.com/openai/codex/issues/4984 as duplicated? @gpeal
Vscode/cursor can't drag file path to codex cli input inside it's integration terminal in recent upgrade.
Still dealing with the same issue, what a joke
Is there a eta already for this? This makes working with Codex super hard compared to Cursor.
+1
The selection is already included in the "auto context". I renamed the issue to focus on the "drag and drop" part of the feature request.
+1
Please let us know if you are planning to pick this feature anytime soon. A lot difficult to work with Codex Chat without this drag and drop feature.
@0xrishavsharma, this feature is specifically for non-image files, which are not currently supported by codex. The Codex IDE extension already supports drag and drop of image files. However, you need to hold the shift key when dropping. This is an unfortunate limitation of VS Code and its extension mechanism.
Hi @etraut-openai, thanks for your response. I totally understand the limitations.
The drag and drop is working if I drag and drop the file along with shift from the workspace listed files(right side on Vscode) but it doesn't work if I try to do that with an opened file tab. Any reason behind it?
As a possible workaround, users can bind the built-in commands for explicitly adding context to the current thread via keyboard shortcuts.
According to the documentation, the extension already exposes the following commands:
Users can assign a custom shortcut to chatgpt.addFileToThread to quickly add the currently opened file to the thread context, partially compensating for the lack of drag-and-drop support.
How to assign a keyboard shortcut in VS Code:
Open Keyboard Shortcuts
– Ctrl+K Ctrl+S (Windows / Linux)
– Cmd+K Cmd+S (macOS)
Search for chatgpt.addFileToThread
Click the pencil icon and assign a preferred key combination
Open a file and use the shortcut to attach the entire file to the current chat thread
This makes adding file context explicit and predictable, especially for larger files or workflows where automatic context detection is insufficient.
6 months and muli-billion dollar company still cant add drag'n drop support? This is a joke?
You are right, it's really a joke.
Not support yet now. :(
Up!
What a joke that you can drag and drop on the Codex app, not on the VSCode extension. Imagining there are multiple files/dirs named the same, when you will have to @ them and compare the already pathetically short clipped path to see which one you are looking for.
Wouldn't it be cool if there existed a coding agent that could fix this problem.....
It's really hard to use the VS Code plugin after using Cursor
UP
Up!