codex icon indicating copy to clipboard operation
codex copied to clipboard

Drag-and-Drop non-image Files

Open CongDon1207 opened this issue 1 year ago • 27 comments

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

CongDon1207 avatar Sep 17 '25 01:09 CongDon1207

+1

Kuntalthakur01 avatar Sep 17 '25 04:09 Kuntalthakur01

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 Image

I'll leave this open to track dragging folders and at-mentioning folders (which is something we want to fix soon).

gpeal avatar Sep 17 '25 17:09 gpeal

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.

rockyicer avatar Sep 17 '25 18:09 rockyicer

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

ale-vigano avatar Sep 18 '25 14:09 ale-vigano

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.

tjx666 avatar Oct 22 '25 07:10 tjx666

Still dealing with the same issue, what a joke

MarkTheCoderShark avatar Oct 31 '25 00:10 MarkTheCoderShark

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

fosple avatar Nov 05 '25 14:11 fosple

+1

paulgould avatar Nov 07 '25 15:11 paulgould

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.

etraut-openai avatar Nov 11 '25 04:11 etraut-openai

+1

GabeRuszala avatar Nov 22 '25 15:11 GabeRuszala

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 avatar Jan 03 '26 08:01 0xrishavsharma

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

etraut-openai avatar Jan 03 '26 15:01 etraut-openai

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?

0xrishavsharma avatar Jan 10 '26 11:01 0xrishavsharma

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.

Eds76 avatar Feb 09 '26 14:02 Eds76

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

igoralentyev avatar Mar 20 '26 16:03 igoralentyev

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.

song526457385202605 avatar Mar 28 '26 01:03 song526457385202605

Not support yet now. :(

p81sunshine avatar Apr 09 '26 04:04 p81sunshine

Up!

emrecpp avatar Apr 17 '26 09:04 emrecpp

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.

KrisCris avatar Apr 21 '26 01:04 KrisCris

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

JustinOhms avatar May 01 '26 23:05 JustinOhms