Skip to content

Instantly share code, notes, and snippets.

@yordanoweb
Created January 21, 2026 14:57
Show Gist options
  • Select an option

  • Save yordanoweb/da35b90390fb2067ca36d47097571294 to your computer and use it in GitHub Desktop.

Select an option

Save yordanoweb/da35b90390fb2067ca36d47097571294 to your computer and use it in GitHub Desktop.
FIX Warp Terminal redirection to browser after xdg-open call

FIX Warp Terminal Redirection to Browser After xdg-open Call

Warp Terminal Login Loop Fix (Linux / xdg-open)

Problem

When logging into Warp Terminal on Linux:

  • Username/password succeeds
  • Browser opens for authentication
  • Final redirect tries to execute via xdg-open
  • Instead of returning to Warp, the browser opens again (infinite loop)

Cause

Warp uses a custom URL scheme (e.g. warp://). On Linux, xdg-open relies on desktop handlers. If Warp is not correctly registered as the handler for its URL scheme, the browser cannot redirect back to the Warp executable.

Solution

  1. Identify the URL scheme

During the browser redirect, copy the URL. It usually starts with:

  warp://

(or similar, e.g. com.warp.dev://)

  1. Check existing handler

Run:

  xdg-mime query default x-scheme-handler/warp

If this returns nothing or an incorrect value, continue.

  1. Create / fix Warp desktop entry

Create the desktop file:

  nano ~/.local/share/applications/warp.desktop

Paste the following (adjust Exec path if needed):

  [Desktop Entry]
  Name=Warp Terminal
  Exec=/usr/bin/warp %u
  Type=Application
  Terminal=false
  MimeType=x-scheme-handler/warp;

Save and exit.

  1. Register the handler

Run:

  update-desktop-database ~/.local/share/applications
  xdg-mime default warp.desktop x-scheme-handler/warp

Verify:

  xdg-mime query default x-scheme-handler/warp

Expected output: warp.desktop

  1. Restart Warp and retry login

Completely close Warp. Open it again and retry the login flow.

The browser redirect should now return control to Warp instead of looping.

Fallback Options

Manual completion:

  • Copy the final redirect URL from the browser
  • In Warp, run:
  warp open "<PASTED_URL>"

or simply paste the URL into Warp.

Optional CLI login (if supported by your version):

  warp login
  warp login --sso
  warp auth

Notes

  • Desktop environments may behave differently (GNOME, KDE, Wayland, etc.)
  • The Warp executable path may vary (check with: which warp)
  • This fix applies to most Linux distributions using xdg-open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment