Skip to content

Raw ANSI escape sequences printed literally: WezTerm + WSL2 (Ubuntu) + Zellij + Nushell (Homebrew) #181

Description

@arisc1994

Environment

Component Value
OS Windows 11 + WSL2 Ubuntu
Terminal WezTerm (Windows host)
Multiplexer Zellij (installed via Homebrew in WSL)
Shell Nushell (installed via Homebrew in WSL)
Homebrew /home/linuxbrew/.linuxbrew
zellij --version   # zellij 0.44.3
nu --version       # 0.114.0

Problem

Image

When launching the stack WezTerm → WSL2 Ubuntu → Nushell → Zellij,
ANSI/color escape sequences are printed as raw literal text instead of
being rendered as colors.

Example of what appears on screen:

/5f5f\000/ffff/87875f5f/8787/afaf0:5f5f/ffff/d7d75f105;rgb:8787/8787/ffffrg
b:8787/d7d7/87878787/ffff/ffff/5f5f/87877/ffff87169;rgb:d7d7/5f5f/afafrgb...

Steps to Reproduce

  1. Open WezTerm on Windows with term = "wezterm" in wezterm.lua
  2. WSL2 Ubuntu launches automatically
  3. Nushell starts via Homebrew (/home/linuxbrew/.linuxbrew/bin/nu)
  4. Zellij auto-starts from env.nu
  5. Raw escape sequences are visible immediately at the prompt

Expected Behavior

Colors and styles render correctly — no raw escape codes visible.

Actual Behavior

Escape sequences like rgb:8787/d7d7/8787 and \5f5f/ffff are printed
as literal text.

Configuration

wezterm.lua

-- Terminal & Colors
-- WSL doesn't have wezterm terminfo, so we use xterm-256color there
-- See: https://github.com/Gentleman-Programming/Gentleman.Dots/issues/117
if wezterm.target_triple:find("windows") then
  config.term = "xterm-256color"
else
  config.term = "wezterm"
end

Diagnostics

# Inside Zellij + Nushell — paste your output:
$env.TERM        # xterm-256color
$env.COLORTERM   # truecolor
infocmp wezterm  # exists? Yes via Reconstructed via infocmp from file: /home/linuxbrew/.linuxbrew/Cellar/ncurses/6.6/share/terminfo/./w/wezterm
wezterm|Wez's Terminal Emulator

Issues Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions