-
-
Notifications
You must be signed in to change notification settings - Fork 751
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set default_cwd on windows #2090
Comments
I am currently facing a similar issue where relevant config: local wezterm = require("wezterm")
-- see https://wezfurlong.org/wezterm/config/lua/wezterm/target_triple.html for values
local is_linux = wezterm.target_triple == "x86_64-unknown-linux-gnu"
local is_windows = wezterm.target_triple == "x86_64-pc-windows-msvc"
local wsl_domains = wezterm.default_wsl_domains()
for idx, dom in ipairs(wsl_domains) do
if dom.name == "WSL:NixOS" then
dom.default_cwd = "/home/nixos"
end
end
return {
default_domain = is_windows and "WSL:Ubuntu" or nil,
default_prog = is_windows and { "wsl.exe" } or nil,
hide_tab_bar_if_only_one_tab = false,
launch_menu = is_windows and { { args = { "cmd.exe" }, domain = { DomainName = "local" } } } or nil,
set_environment_variables = {
TERMINFO_DIRS = "/home/" .. (os.getenv("USERNAME") or os.getenv("USER")) .. "/.nix-profile/share/terminfo",
WSLENV = "TERMINFO_DIRS",
prompt = is_windows and "$E]7;file://localhost/$P$E\\$E[32m$T$E[0m $E[35m$P$E[36m$_$G$E[0m " or nil,
},
-- term = "wezterm",
wsl_domains = wsl_domains,
} |
@SuperSandro2000 I find the And this config work for me. local wsl_domains = wezterm.default_wsl_domains()
for _, dom in ipairs(wsl_domains) do
dom.default_cwd = "~"
end
return {
wsl_domains = wsl_domains,
default_domain = "WSL:Arch",
default_prog = { "wsl.exe" },
} |
But when i use command to start wezterm,it show this log and the wezterm window is stuck.
|
I just pushed a fix for #2092 which could also be influencing what you're seeing here; it can certainly confuse things. |
I think what @SuperSandro2000 was seeing was more #2092 than this issue. @ackerr: your comment in #2090 (comment) is what I'd suggest for the issue you originally describe. The behavior when spawning is to use the normal default_cwd resolution logic, then pass that to the spawned program. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I want the default pwd is wsl's $HOME when wezterm start,but it always the windows $HOME.
And i find the
default_cwd
config,set it to other path likeC:\Users\Ackerr\.config\wezterm
,but it's not work, always the $HOME(C:\Users\Ackerr). And i use this commandwezterm start --cwd C:\Users\Ackerr\.config\wezterm
,it's not work too.the minimum config
wezterm version
The text was updated successfully, but these errors were encountered: