t3code icon indicating copy to clipboard operation
t3code copied to clipboard

WSL support

Open patchzyy opened this issue 8 months ago • 25 comments

When running on windows it would be nice to have the app use codex through WSL since codex (and other harnesses) do seem to run better in linux , or atleast an option for it to enable and disable it (so either using it through windows powershell nativally or WSL)

patchzyy avatar Mar 06 '26 23:03 patchzyy

Up! I use windows but basically all my development projects live in wsl2 (ubuntu).

sebherrerabe avatar Mar 07 '26 11:03 sebherrerabe

As a suggestion, if you're smart with the remote agent / runner implementation, you can just implement WSL support as a remote server, but instead of say using ssh to start the remote runner you use the wsl command with distro selection.

Codex did recently release their Windows app with WSL support, but one of the downsides of it is that you are stuck with either running on WSL or local windows, instead of having it as a per project and/or per thread setup.

SandGiant-Lunarchild avatar Mar 07 '26 12:03 SandGiant-Lunarchild

As a suggestion, if you're smart with the remote agent / runner implementation, you can just implement WSL support as a remote server, but instead of say using ssh to start the remote runner you use the wsl command with distro selection.

Codex did recently release their Windows app with WSL support, but one of the downsides of it is that you are stuck with either running on WSL or local windows, instead of having it as a per project and/or per thread setup.

I still believe that it would be great to have native support for WSL and therefore enhance that config per project feature in t3code that the codex app is missing.

I get errors like this when trying to work in a WSL project

Image

sebherrerabe avatar Mar 07 '26 14:03 sebherrerabe

Hmm, so you want your Windows copy of Codex to run over the special WSL exposed network paths? Curious. Though that particular error seems to be a problem with your git installation rather than anything to do with t3 code.

What I'm talking about is having the "remote agent" support run the codex inside of WSL instead, using the WSL installation of Codex. That way you wouldn't need to use the wsl network path.

SandGiant-Lunarchild avatar Mar 07 '26 17:03 SandGiant-Lunarchild

I’ve been testing the Codex app (the one from Open AI) for Windows. It looks like they’ve integrated it with WSL, but the app itself is extremely slow (the entire point of T3Code yes?). The Codex CLI runs perfectly inside WSL with no problems. The slowness seems to be specific to the Codex desktop app.

Image

If the T3Code app supported a proper WSL mode, it could get Linux-like performance and behavior while still running inside the Windows environment. I'm very excited for all of this, T3code is the absolute opposite of 'slugsh' even in it's alpha state.

citricguy avatar Mar 07 '26 20:03 citricguy

Has anyone managed to get it running with Xlaunch by just running the linux version under wsl2 directly? I'm going to give that a shot and post instructions here if it works

linuxdropout avatar Mar 07 '26 22:03 linuxdropout

Has anyone managed to get it running with Xlaunch by just running the linux version under wsl2 directly?

Yupp. I think. 🤷

Here's what I did. Provided that you're on wsl 2 and I used ubuntu 24.04.1 LTS for this but you can use any compatible distro.

1. Update and install xlaunch

sudo apt update
sudo apt install -y libfuse2t64
sudo apt install -y x11-apps

2. Verify xlaunch is installed via xeyes

xeyes

A simple ubuntu-looking app should pop-up inside windows, it should respond to and follow your mouse pointer.

3. Download latest app image and prepare to run

wget https://github.com/pingdotgg/t3code/releases/download/v0.0.4/T3-Code-0.0.4-x86_64.AppImage
mkdir -p ~/apps/t3code
mv T3-Code-0.0.4-x86_64.AppImage ~/apps/t3code
cd ~/apps/t3code
chmod +x T3-Code-0.0.4-x86_64.AppImage
echo "alias t3code='cd ~/apps/t3code/ && ./T3-Code-0.0.4-x86_64.AppImage'" >> ~/.bash_aliases
source ~/.bash_aliases
t3code

You should have an instance of t3code running by this point.

I am no expert of xlaunch or even wsl ins-and-outs but I have been met with quite a few issues with the UX in general:

  • dark mode is not default - could be an xlaunch or wsl problem
  • change diffs are completely broken, including codex checkpoints
Image

tewbamohammed-arch avatar Mar 08 '26 01:03 tewbamohammed-arch

I’ve been testing the Codex app (the one from Open AI) for Windows. It looks like they’ve integrated it with WSL, but the app itself is extremely slow (the entire point of T3Code yes?). The Codex CLI runs perfectly inside WSL with no problems. The slowness seems to be specific to the Codex desktop app.

Image If the T3Code app supported a proper WSL mode, it could get Linux-like performance and behavior while still running inside the Windows environment. I'm _very_ excited for all of this, T3code is the absolute opposite of '_slugsh'_ even in it's alpha state.

It does support WSL, but it still seems to run a lot of PowerShell commands and pretty much executes "bash " from the windows side to execute everything.

I agree that the T3 team should add WSL integrated support.

Dastari avatar Mar 08 '26 02:03 Dastari

Opus suggested this for me:

 Got the Windows app running with WSL projects. Two things broke, here's how I fixed both:
  1. "codex not recognized"

  Create a file called codex.cmd in C:\Users\<you>\AppData\Local\Microsoft\WindowsApps\ (already on your
   PATH, no extra setup):

  @echo off
  wsl codex %*

  That's it. Windows will now forward codex calls to your WSL install automatically.

  2. Checkpoint git errors

  If you see fatal: detected dubious ownership in repository at '//wsl.localhost/...', add this to
  C:\Users\<you>\.gitconfig:

  [safe]
      directory = %(prefix)///wsl.localhost/Ubuntu-24.04/mnt/data/your-project

  ⚠️ Don't quote the value — git will break with a not absolute error if you do (learned that the hard
  way).

  Or via command line (run from PowerShell/cmd, not WSL):
  git config --global --add safe.directory %(prefix)///wsl.localhost/Ubuntu-24.04/mnt/data/your-project

Seems to be working for me now.

a12233 avatar Mar 08 '26 02:03 a12233

Ooooh wanted to use it, but all my development is inside WSL 🥴

EDIT: I see if I run it with npx t3 inside WSL a browser opens and I can use it. Well, for now it works.

irian-codes avatar Mar 09 '26 09:03 irian-codes

Ooooh wanted to use it, but all my development is inside WSL 🥴

EDIT: I see if I run it with npx t3 inside WSL a browser opens and I can use it. Well, for now it works.

Yes this is how I'm running it. What is SUPER cool is that if you port setup port forwarding, I can monitor and code from my iPad in bed :) Which is just.. game changing.

Dastari avatar Mar 09 '26 11:03 Dastari

I run it in WSL.

  1. Open wsl terminal and type in npx t3
  2. The app opens in a browser window.
  3. Enjoy.

Of course, it has limitations:

  1. Needs the browser
  2. all paths are garbage and do nothing.
Image

^ ^ that's an example.

GabeAl avatar Mar 10 '26 20:03 GabeAl

@t3dotgg any update on when we might see an update on WSL integration?

shurkanTwo avatar Mar 28 '26 20:03 shurkanTwo

fuck I also have in my WSL env

johan149 avatar Apr 06 '26 03:04 johan149

The best UI in the world still doesn't support WSL?

phob avatar Apr 06 '26 06:04 phob

Wtf guys, waiting for it for weeks already

archasek avatar Apr 06 '26 08:04 archasek

Gents... patience. You are getting this for free. Look at the ticket content, this is not an easy fix.

I'm also waiting, but if this is like any of the other t3 products we're in for a treat.

Tokolosk avatar Apr 06 '26 13:04 Tokolosk

Not sure if this helps, but adding my comment here to show support for the feature.

AveshLutchman avatar Apr 28 '26 13:04 AveshLutchman

I tried connecting my WSL2 environment via SSH, resulted in #2534 Maybe you guys are having more luck than me.

yutamago avatar May 05 '26 21:05 yutamago

Workaround that’s working well for me on Windows + WSL:

I run T3 Code from inside WSL, but prevent it from opening my default browser. My WSL script starts the server with:

npx t3 start --no-browser --mode web --host 127.0.0.1 --port 3773

The script waits until http://localhost:3773 is reachable, then opens it in Microsoft Edge using --app and a dedicated --user-data-dir. That gives me a separate T3 Code window/profile instead of another tab in my normal browser.

On Windows, AutoHotkey handles shortcuts: Alt+3 focuses the existing T3 window or starts it through WSL, and Alt+Shift+3 stops the T3 server.

Scripts

t3code-app

#!/usr/bin/env bash
set -Eeuo pipefail

export NVM_DIR="${NVM_DIR:-$HOME/.nvm}"
if [[ -s "$NVM_DIR/nvm.sh" ]]; then
  . "$NVM_DIR/nvm.sh"
fi

port="${T3CODE_APP_PORT:-3773}"
host="${T3CODE_APP_HOST:-127.0.0.1}"
url="http://localhost:${port}"

browser_exe="/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
profile_dir="${T3CODE_APP_PROFILE:-/mnt/c/Users/abdul/AppData/Local/T3CodeEdgeProfile}"

mkdir -p "$profile_dir"
profile_win="$(wslpath -w "$profile_dir")"

is_t3_up() {
  curl --silent --fail --max-time 1 "$url" >/dev/null 2>&1
}

open_t3_window() {
  "$browser_exe" \
    --user-data-dir="$profile_win" \
    --no-first-run \
    --no-default-browser-check \
    --app="$url" \
    >/dev/null 2>&1 &
}

if is_t3_up; then
  open_t3_window
  exit 0
fi

npx t3 start \
  --no-browser \
  --mode web \
  --host "$host" \
  --port "$port" &

t3_pid=$!

for _ in {1..80}; do
  if is_t3_up; then
    open_t3_window
    break
  fi
  sleep 0.25
done

wait "$t3_pid"

t3code-stop

#!/usr/bin/env bash
set -u

pkill -f 'node .*t3' >/dev/null 2>&1 || true

AutoHotkey v2

; Alt + 3 → T3Code
!3:: {
    if WinExist("T3 Code ahk_exe msedge.exe") {
        WinActivate()
    } else {
        Run("C:\Users\abdul\t3code.cmd",, "Hide")
    }
}

; Alt + Shift + 3 → Stop T3Code server
!+3:: {
    Run("C:\Users\abdul\t3code-stop.cmd",, "Hide")
}

t3code.cmd

@echo off
wsl.exe -d Ubuntu --cd ~ --exec /home/zorex/.local/bin/t3code-app

t3code-stop.cmd

@echo off
wsl.exe -d Ubuntu --exec /home/zorex/.local/bin/t3code-stop

AbdelhamidQ avatar May 12 '26 14:05 AbdelhamidQ