Skip to content

laffo16/WSL-Codex-Snapshot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

WSL Codex Snapshot (with interop disabled)

Description

When running Codex in a WSL bash window with WSL interop disabled to reduce access from WSL to Windows tools, Codex’s “paste screenshot / paste image from clipboard” workflow can stop working because it relies on Windows-side clipboard access via interop. This script works around that by saving the current clipboard image inside WSL and pasting the resulting WSL file path as plain text into the terminal. Code is in an experimental / early development state.

What it does

When you press the hotkey (ctrl + alt + f):

  1. Saves the image currently in your clipboard to /home/<user>/.codex/clipboard/ in WSL
  2. Pastes the resulting WSL file path into the active WSL console window
  3. Restores your clipboard image afterwards (so you don’t lose the screenshot)

Quick start

  1. Download the latest wsl-codex-snapshot-*.exe from GitHub Releases (recommended), or install AutoIt v3 and run wsl-codex-snapshot.au3
  2. Copy a screenshot to your clipboard (snip with shift + windows key + s)
  3. Focus your WSL Codex console window
  4. Press ctrl + alt + f

You should see the path pasted into the terminal. Tooltips are shown only for errors (for example: no image on the clipboard, or the active window isn’t the expected WSL console).

Where files go

Saved to:

/home/<user>/.codex/clipboard/clip_*.png

This script keeps the latest 10 images (older clip_*.png files are pruned).

The clipboard/ folder is created automatically when saving.

Requirements / limitations

  • Works with the classic Windows console window (ConsoleWindowClass) and Windows Terminal (CASCADIA_HOSTING_WINDOW_CLASS).
  • In the classic Windows console, it expects English menu labels (Edit -> Paste).
  • The WSL window title must include "{user}@{machinename}:" (used to detect the target window and extract <user>).
  • /home/<user>/.codex/ must already exist.

Exit

An AutoIt tray icon appears while running. Right-click it to exit the script.

License

MIT — free to use, modify, and share. See LICENSE.

About

Save clipboard screenshots into WSL and paste the path into Codex when interop is disabled

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages