Skip to content

Commit 69db9cd

Browse files
authored
fix(windows): devtools opening (#492)
1 parent 65b7399 commit 69db9cd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lua/flutter-tools/dev_tools.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ end
4545

4646
---@param url string
4747
local function open_dev_tools(url)
48-
local open_command = utils.open_command()
48+
local open_command, args = utils.open_command()
4949
if not open_command then
5050
return ui.notify(
5151
"Sorry your Operating System is not supported, please raise an issue",
5252
ui.ERROR
5353
)
5454
end
55-
55+
table.insert(args, url)
5656
Job:new({
5757
command = open_command,
58-
args = { url },
58+
args = args,
5959
detached = true,
6060
}):start()
6161
end

lua/flutter-tools/utils/init.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ function M.get_hl(name, attribute)
9898
end
9999

100100
function M.open_command()
101-
if path.is_mac then return "open" end
102-
if path.is_linux then return "xdg-open" end
103-
if path.is_windows then return "explorer" end
101+
if path.is_mac then return "open", {} end
102+
if path.is_linux then return "xdg-open", {} end
103+
if path.is_windows then return "cmd.exe", { "/c", "start" } end
104104
return nil, nil
105105
end
106106

0 commit comments

Comments
 (0)