Fix script/zed-local
on non-Windows platforms (#28098)
This PR fixes the `script/zed-local` script, which was no longer working properly after https://github.com/zed-industries/zed/pull/23117. Release Notes: - N/A
This commit is contained in:
parent
cfe5620a2a
commit
982196343f
1 changed files with 10 additions and 7 deletions
|
@ -117,7 +117,7 @@ if (platform === "darwin") {
|
||||||
try {
|
try {
|
||||||
const resolutionOutput = execSync(
|
const resolutionOutput = execSync(
|
||||||
`powershell -Command "& {Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Screen]::PrimaryScreen.WorkingArea.Size}"`,
|
`powershell -Command "& {Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Screen]::PrimaryScreen.WorkingArea.Size}"`,
|
||||||
{ encoding: "utf8" }
|
{ encoding: "utf8" },
|
||||||
).trim();
|
).trim();
|
||||||
[screenWidth, screenHeight] = resolutionOutput.match(/\d+/g).map(Number);
|
[screenWidth, screenHeight] = resolutionOutput.match(/\d+/g).map(Number);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
@ -184,10 +184,7 @@ setTimeout(() => {
|
||||||
const column = i % columns;
|
const column = i % columns;
|
||||||
let position;
|
let position;
|
||||||
if (platform == "win32") {
|
if (platform == "win32") {
|
||||||
position = [
|
position = [column * instanceWidth, row * instanceHeight].join(",");
|
||||||
column * instanceWidth,
|
|
||||||
row * instanceHeight,
|
|
||||||
].join(",");
|
|
||||||
} else {
|
} else {
|
||||||
position = [
|
position = [
|
||||||
column * instanceWidth,
|
column * instanceWidth,
|
||||||
|
@ -208,8 +205,14 @@ setTimeout(() => {
|
||||||
ZED_WINDOW_POSITION: position,
|
ZED_WINDOW_POSITION: position,
|
||||||
ZED_STATELESS: isStateful && i == 0 ? "" : "1",
|
ZED_STATELESS: isStateful && i == 0 ? "" : "1",
|
||||||
ZED_ALWAYS_ACTIVE: "1",
|
ZED_ALWAYS_ACTIVE: "1",
|
||||||
ZED_SERVER_URL: "http://127.0.0.1:3000", // On windows, the http_client could not parse localhost
|
ZED_SERVER_URL:
|
||||||
ZED_RPC_URL: "http://127.0.0.1:8080/rpc",
|
platform === "win32"
|
||||||
|
? "http://127.0.0.1:3000"
|
||||||
|
: "http://localhost:3000",
|
||||||
|
ZED_RPC_URL:
|
||||||
|
platform === "win32"
|
||||||
|
? "http://127.0.0.1:8080/rpc"
|
||||||
|
: "http://localhost:8080/rpc",
|
||||||
ZED_ADMIN_API_TOKEN: "secret",
|
ZED_ADMIN_API_TOKEN: "secret",
|
||||||
ZED_WINDOW_SIZE: size,
|
ZED_WINDOW_SIZE: size,
|
||||||
ZED_CLIENT_CHECKSUM_SEED: "development-checksum-seed",
|
ZED_CLIENT_CHECKSUM_SEED: "development-checksum-seed",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue