Use Windows settings editor command
This commit is contained in:
29
wezterm.lua
29
wezterm.lua
@@ -147,11 +147,27 @@ config.unix_domains = {
|
||||
{ name = "unix" },
|
||||
}
|
||||
|
||||
local config_file = "/mnt/storage/wezterm.lua"
|
||||
local is_windows = wezterm.target_triple:find("windows") ~= nil
|
||||
local config_file = is_windows and (wezterm.home_dir .. "\\.wezterm.lua") or "/mnt/storage/wezterm.lua"
|
||||
|
||||
local function open_config_section(window, pane, line)
|
||||
window:perform_action(
|
||||
act.SpawnCommandInNewTab({
|
||||
local args
|
||||
if is_windows then
|
||||
args = {
|
||||
"powershell.exe",
|
||||
"-NoLogo",
|
||||
"-NoExit",
|
||||
"-Command",
|
||||
string.format(
|
||||
'$file = %q; $line = %d; '
|
||||
.. '$code = Get-Command code.cmd,code -ErrorAction SilentlyContinue | Select-Object -First 1; '
|
||||
.. 'if ($code) { & $code.Source -g "${file}:${line}" } '
|
||||
.. 'else { Write-Host "VS Code not found. Opening Notepad without line jump."; notepad.exe $file }',
|
||||
config_file,
|
||||
line
|
||||
),
|
||||
}
|
||||
else
|
||||
args = {
|
||||
"sh",
|
||||
"-lc",
|
||||
@@ -164,8 +180,11 @@ local function open_config_section(window, pane, line)
|
||||
config_file,
|
||||
line
|
||||
),
|
||||
},
|
||||
}),
|
||||
}
|
||||
end
|
||||
|
||||
window:perform_action(
|
||||
act.SpawnCommandInNewTab({ args = args }),
|
||||
pane
|
||||
)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user