From 4a8c4d1c3061346fea549f8d6fc13fd10fddf2fb Mon Sep 17 00:00:00 2001 From: Sandro Date: Wed, 21 Jul 2021 17:05:14 +0200 Subject: [PATCH] docs/term: add information to make it work with WSL (#936) * docs/term: add information to make it work with WSL * Adapt recent changes that automatically set WSLENV, add info on how to install terminfo with nixpkgs * Apply suggestions from code review Co-authored-by: Wez Furlong --- docs/config/lua/config/term.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/config/lua/config/term.md b/docs/config/lua/config/term.md index c5e386ca4..c167fc168 100644 --- a/docs/config/lua/config/term.md +++ b/docs/config/lua/config/term.md @@ -22,3 +22,16 @@ as colored underlines, styled underlines (eg: undercurl). If the system you are using has a relatively outdated ncurses installation, the `wezterm` terminfo will also enable italics and true color support. +If you are using WSL, wezterm will automatically populate `WSLENV` to properly set TERM, COLORTERM, TERM_PROGRAM and TERM_PROGRAM_VERSION in the environment when crossing between win32 and WSL environments. +See [this Microsoft blog post](https://devblogs.microsoft.com/commandline/share-environment-vars-between-wsl-and-windows/#what-are-environment-variables) for more information on how `WSLENV` works. + +If your package manager installed the terminfo data in a non-standard location, which will likely be the case if your are using nixpkgs/home-manager/NixOS, then you need to set `TERMINFO_DIRS` in the environment in order for applications to find it. +The following snippet works if you installed `wezterm.terminfo` with nix into your user profile. Update the path to `TERMINFO_DIRS` to match the location on your system. + +```lua + set_environment_variables={ + TERMINFO_DIRS='/home/user/.nix-profile/share/terminfo', + WSLENV='TERMINFO_DIRS' + }, + term = "wezterm", +```