#WSLENV

4 messages · Page 1 of 1 (latest)

upbeat summit
#

I'm running an Ubuntu WSL, and Warp on windows to connect to it.
I have configured a WSLENV in my windows environment variables, that will be shared to my Ubuntu WSL.
This works when I use the Ubuntu terminal:

WSLENV=CAROOT/up:WT_SESSION:WT_PROFILE_ID:
snerkdevil@Predator:~$ echo $CAROOT
/mnt/c/Users/SnerkDevil/AppData/Local/mkcert```

but not when using Warp:

```snerkdevil@Predator:~$ env | grep WSLENV
WSLENV=WARP_HONOR_PS1/u:WARP_USE_SSH_WRAPPER/u:WARP_SHELL_DEBUG_MODE/u:TERM_PROGRAM/u:WARP_IS_LOCAL_SHELL_SESSION/u:SSH_SOCKET_DIR/u:WARP_INI

How can I make this work? I tried using the Warp prompt, and Shell prompt.

strong cobaltBOT
#

Hi @upbeat summit. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the knowledge sources, I can see that you're experiencing an issue with environment variables in Warp when connecting to your Ubuntu WSL from Windows.

The issue appears to be that Warp is overriding your Windows-defined WSLENV variable with its own Warp-specific environment variables. This is preventing your custom Windows environment variables from being passed to the WSL environment when using Warp.

There are a few potential solutions you could try:

  1. Use Warp's environment variables feature: You can create environment variables in Warp Drive and load them into your session. This would allow you to manually set the CAROOT variable in your WSL session through Warp. You can load these variables by clicking to load into a current session or when running a workflow.

  2. Source your environment variables in your shell profile: Several users in the knowledge sources mentioned solving similar environment variable issues by adding their environment variables to their shell profile files. You could add your CAROOT export to your ~/.bashrc or ~/.bash_profile file:

    export CAROOT="/mnt/c/Users/SnerkDevil/AppData/Local/mkcert"
    
  3. Create a feature request: This appears to be a limitation in how Warp handles the WSLENV variable when connecting to WSL. You might want to create a feature request on the Warp GitHub repository to request better handling of pre-existing WSLENV variables.

#

The knowledge sources indicate that Warp on Windows is still relatively new (released in April 2024), and the team is actively working on improving the experience, particularly around shell integration and environment handling. As mentioned in the Building Warp on Windows blog post, supporting WSL shells required special consideration for file paths and other integration points.

If none of these solutions work for you, you might need to continue using the Ubuntu terminal for tasks that require these specific environment variables until this issue is addressed in Warp.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: