Skip to content

Commit

Permalink
Workaround a WSL systemd issue.
Browse files Browse the repository at this point in the history
WSL systemd doesn't reliably provide a user session; that is, `systemctl --user status` may fail.
This commit provides a workaround based on:
  microsoft/WSL#10205 (comment)
  • Loading branch information
yipengsun committed Sep 26, 2024
1 parent c7cb8ab commit c727580
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion config/wezterm/wezterm.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,15 @@ config.wsl_domains = {
{
name = 'WSL:NixOS',
distribution = 'NixOS',
default_prog = { '/run/current-system/sw/bin/fish' },
default_prog = {
'/run/current-system/sw/bin/fish',
'-c',
-- to get a working user login session
'while not test -S /run/dbus/system_bus_socket; sleep 1; end;' ..
'if test -e /run/user/1000/bus; exec fish; end;' ..
'sudo systemctl restart user@1000.service;' ..
'exec fish;',
},
default_cwd = '~',
},
}
Expand Down

0 comments on commit c727580

Please sign in to comment.