wezterm icon indicating copy to clipboard operation
wezterm copied to clipboard

WSL - `default_cwd` UNC path only works in the first tab opened

Open gsuuon opened this issue 1 year ago • 3 comments

What Operating System(s) are you seeing this problem on?

Windows

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

wezterm 20240520-135708-b8f94c47

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

When default_cwd is an UNC path like //wsl.localhost/Ubuntu-22.04/home/gsuuon from wslpath -am ~ and default_prog is wsl, the first time opening wezterm the cwd is set but the second attempt seems to strip the leading / and error.

To Reproduce

  1. start wezterm with below config (replacing distro/username)
  2. open another tab

Configuration

return {
  default_prog = { 'wsl' },
  default_cwd = '//wsl.localhost/Ubuntu-22.04/home/gsuuon'
}

Expected Behavior

Can open multiple tabs at default_cwd

Logs

22:31:39.537  WARN   mux::domain > Directory "/wsl.localhost/Ubuntu-22.04/home/gsuuon/" is not readable and will not be used for the command we are spawning: The system cannot find the path specified. (os error 3)

Anything else?

This shell is not set to report OSC 7, though maybe it's pulling the path some other way?

I tried with a non-~ path and see the same behavior. Also tried with ///wsl.localhost.. and that errors the first time and fails to set cwd the second.

I tried with return { default_domains = 'WSL:Ubuntu-22.04' } and that seems to have the same issue, where the first tab opens to ~ within wsl and the second opens to /mnt/c/Users/gsuuon (on Windows) but there's no error.

gsuuon avatar Jun 02 '24 03:06 gsuuon

inverse is a new color mode adaptive theme color, and we already have secondary, so going to call this fixed in v6-dev. All our theme colors are now color-mode adaptive.

mdo avatar Dec 17 '25 00:12 mdo