Drag-and-Drop non-image Files

Open 💬 22 comments Opened Sep 17, 2025 by CongDon1207
💡 Likely answer: A maintainer (gpeal, contributor) responded on this thread — see the highlighted reply below.

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_

View original on GitHub ↗

22 Comments

Kuntalthakur01 · 10 months ago

+1

gpeal contributor · 10 months ago
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.

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).

rockyicer · 10 months ago

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.

ale-vigano · 10 months ago

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

tjx666 · 9 months ago

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.

MarkTheCoderShark · 8 months ago

Still dealing with the same issue, what a joke

fosple · 8 months ago

Is there a eta already for this? This makes working with Codex super hard compared to Cursor.

paulgould · 8 months ago

+1

etraut-openai contributor · 8 months ago

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.

GabeRuszala · 8 months ago

+1

0xrishavsharma · 6 months ago

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.

etraut-openai contributor · 6 months ago

@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.

0xrishavsharma · 6 months ago

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?

Eds76 · 5 months ago

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:

Command                         Default key binding   Description
chatgpt.addToThread             –                     Add selected text range as context for the current thread
chatgpt.addFileToThread         –                     Add the entire file as context for the current thread

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.

igoralentyev · 4 months ago

6 months and muli-billion dollar company still cant add drag'n drop support? This is a joke?

song526457385202605 · 3 months ago
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.

p81sunshine · 3 months ago

Not support yet now. :(

emrecpp · 3 months ago

Up!

KrisCris · 3 months ago

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.

JustinOhms · 2 months ago

Wouldn't it be cool if there existed a coding agent that could fix this problem.....

Hazyshades · 2 months ago

It's really hard to use the VS Code plugin after using Cursor
UP

cod3blox · 2 months ago

Up!