GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(editors): find JetBrains IDEs whose Toolbox script is named idea1 by only21mil · Pull Request #23743 · pingdotgg/t3code

fix(editors): find JetBrains IDEs whose Toolbox script is named idea1 #23743

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.

Sign up for GitHub

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

Merged
juliusmarminge merged 33 commits into pingdotgg:main from only21mil:r13/a218-discover-numbered-jetbrains-toolbox-laun
Nov 14, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

fix(editors): find JetBrains IDEs whose Toolbox script is named idea1 #23743

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bb4ec4e
test(server): pin numbered JetBrains Toolbox script discovery
only21mil Oct 22, 2026
15c0b0c
fix(editors): discover numbered JetBrains Toolbox launch scripts
only21mil Oct 22, 2026
68199a7
test(server): pin skipping a numbered Toolbox script whose IDE was re…
only21mil Oct 22, 2026
9ed21c0
fix(editors): skip numbered Toolbox scripts whose IDE was removed
only21mil Oct 22, 2026
de09175
refactor(editors): trace the Toolbox launch-target check with Effect.fn
only21mil Oct 22, 2026
f8c8f40
test(server): cover Toolbox launchers with HOME-based targets
only21mil Oct 22, 2026
1c62af9
fix(editors): expand HOME in numbered Toolbox launcher targets
only21mil Oct 22, 2026
f27f9b6
style(editors): format the HOME target expansion
only21mil Oct 22, 2026
fb37378
fix(editors): check only the launched IDE in numbered Toolbox scripts
only21mil Oct 24, 2026
fd77610
test(server): fold the removed-IDE Toolbox case into the HOME target …
only21mil Oct 31, 2026
46c07bf
test(server): keep only the win32 row of the numbered Toolbox discove…
only21mil Oct 31, 2026
1bd3a70
refactor(editors): trace the numbered Toolbox script scan with Effect.fn
only21mil Oct 31, 2026
cda8cfd
fix(editors): skip a stale canonical Toolbox script and read start sw…
only21mil Nov 1, 2026
ca18162
refactor(editors): simplify the start title and Linux Toolbox lookup
only21mil Nov 1, 2026
1d72002
fix(editors): keep canonical Toolbox scripts with variable launch lines
only21mil Nov 1, 2026
edeb174
refactor(editors): treat any launch through a variable as unknown
only21mil Nov 1, 2026
aea5471
fix(editors): keep a canonical Toolbox script that names an existing …
only21mil Nov 1, 2026
2b83541
fix(editors): keep a canonical Toolbox script that uses any variable
only21mil Nov 1, 2026
7d0502b
fix(editors): keep a canonical Toolbox script with an escaped space
only21mil Nov 1, 2026
5f47f1c
fix(editors): expand ~/ in Toolbox launch targets
only21mil Nov 1, 2026
f6949af
chore: merge main into numbered toolbox launcher fix
maria-rcks Nov 1, 2026
2cdc837
fix(editors): do not validate toolbox scripts by env wrapper
maria-rcks Nov 1, 2026
2429ef8
test(server): isolate toolbox discovery from host editors
maria-rcks Nov 1, 2026
a8db311
test(server): cover the launch scripts JetBrains Toolbox writes
only21mil Nov 11, 2026
71b1b5a
fix(editors): skip a stale Toolbox script on PATH and read Toolbox's …
only21mil Nov 11, 2026
6d49d51
chore: merge main into numbered toolbox launcher fix
only21mil Nov 11, 2026
2dbf495
Merge branch 'main' into r13/a218-discover-numbered-jetbrains-toolbox…
only21mil Nov 12, 2026
f115fec
style(editors): document launchedProgram instead of scriptWords
only21mil Nov 12, 2026
077d225
Merge origin/main into numbered toolbox launcher fix
juliusmarminge Nov 13, 2026
46421bf
refactor(editors): find numbered Toolbox scripts without parsing them
juliusmarminge Nov 13, 2026
79b7355
Merge origin/main into numbered Toolbox launcher fix
juliusmarminge Nov 13, 2026
9e6290c
Merge origin/main into numbered Toolbox launcher fix
juliusmarminge Nov 14, 2026
e99cec0
fix(editors): try numbered Toolbox scripts after every canonical cand…
juliusmarminge Nov 14, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

56 changes: 56 additions & 0 deletions 56 apps/server/src/process/externalLauncher.test.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,62 @@ it.effect("keeps the macOS VS Code Insiders bundle out of stable VS Code", () =>
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
);

it.effect.each([
{
platform: "darwin",
scripts: "Library/Application Support/JetBrains/Toolbox/scripts",
suffix: "",
},
{ platform: "linux", scripts: ".local/share/JetBrains/Toolbox/scripts", suffix: "" },
{ platform: "win32", scripts: "JetBrains/Toolbox/scripts", suffix: ".cmd" },
{
platform: "win32",
scripts: "JetBrains/Toolbox/scripts",
suffix: ".cmd",
install: "Programs/IntelliJ IDEA/bin/idea64.exe",
},
] as const)(
"discovers a numbered JetBrains Toolbox script on $platform",
({ platform, scripts, suffix, ...row }) =>
Effect.gen(function* () {
const fs = yield* FileSystem.FileSystem;
const path = yield* Path.Path;
const home = yield* fs.makeTempDirectoryScoped({ prefix: "t3-toolbox-numbered-" });
const dir = path.join(home, scripts);
yield* fs.makeDirectory(dir, { recursive: true });
for (const name of ["idea10", "idea2"]) {
yield* fs.writeFileString(path.join(dir, `${name}${suffix}`), "#!/bin/sh\n");
yield* fs.chmod(path.join(dir, `${name}${suffix}`), 0o755);
}
const install = "install" in row ? path.join(home, row.install) : undefined;
if (install) {
yield* fs.makeDirectory(path.dirname(install), { recursive: true });
yield* fs.writeFileString(install, "");
}

const editor = EDITORS.find((editor) => editor.id === "idea")!;
const resolved = yield* resolveEditorCommand(editor, {
HOME: home,
LOCALAPPDATA: home,
PATH: path.join(home, "empty"),
PATHEXT: ".COM;.EXE;.BAT;.CMD",
}).pipe(
Effect.provideService(HostProcess.Platform, platform),
// Keep IDEs installed on the host out of system locations such as /Applications.
Effect.provideService(FileSystem.FileSystem, {
...fs,
stat: (file) =>
fs.stat(file.startsWith(`${home}${path.sep}`) ? file : path.join(home, "missing")),
}),
);

assert.deepEqual(
resolved,
Option.some({ command: install ?? path.join(dir, `idea2${suffix}`), baseArgs: [] }),
);
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
);

for (const { platform, installPath, onPath } of [
{ platform: "darwin", installPath: ".local/bin/agy", onPath: true },
{ platform: "linux", installPath: ".local/bin/agy", onPath: false },
Expand Down
36 changes: 29 additions & 7 deletions 36 packages/shared/src/editor.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const resolveEditorCommand = Effect.fn("editor.resolveEditorCommand")(fun
const command = editor.commands[0];
const jetbrains = editor.launchStyle === "line-column";
const candidates: string[] = [];
let toolbox: { dir: string; suffix: string } | undefined;

if (platform === "darwin") {
const roots = [...(home ? [path.join(home, "Applications")] : []), "/Applications"];
Expand All @@ -97,9 +98,11 @@ export const resolveEditorCommand = Effect.fn("editor.resolveEditorCommand")(fun
}
}
if (home && jetbrains) {
candidates.push(
path.join(home, "Library/Application Support/JetBrains/Toolbox/scripts", command),
);
toolbox = {
dir: path.join(home, "Library/Application Support/JetBrains/Toolbox/scripts"),
suffix: "",
};
candidates.push(path.join(toolbox.dir, command));
}
} else if (platform === "win32") {
const roots = [
Expand All @@ -110,7 +113,8 @@ export const resolveEditorCommand = Effect.fn("editor.resolveEditorCommand")(fun
];
if (jetbrains) {
if (env.LOCALAPPDATA) {
candidates.push(path.join(env.LOCALAPPDATA, "JetBrains/Toolbox/scripts", `${command}.cmd`));
toolbox = { dir: path.join(env.LOCALAPPDATA, "JetBrains/Toolbox/scripts"), suffix: ".cmd" };
candidates.push(path.join(toolbox.dir, `${command}.cmd`));
}
for (const directory of roots.flatMap((root) => [root, path.join(root, "JetBrains")])) {
const entries = yield* fs.readDirectory(directory).pipe(Effect.orElseSucceed(() => []));
Expand Down Expand Up @@ -150,9 +154,10 @@ export const resolveEditorCommand = Effect.fn("editor.resolveEditorCommand")(fun
"/usr/bin",
"/snap/bin",
];
if (jetbrains) {
const dataHome = env.XDG_DATA_HOME || (home ? path.join(home, ".local/share") : undefined);
if (dataHome) dirs.push(path.join(dataHome, "JetBrains/Toolbox/scripts"));
const dataHome = env.XDG_DATA_HOME || (home ? path.join(home, ".local/share") : undefined);
if (jetbrains && dataHome) {
toolbox = { dir: path.join(dataHome, "JetBrains/Toolbox/scripts"), suffix: "" };
dirs.push(toolbox.dir);
}
if (preferZeditor) {
// Linux packages use zeditor because OpenZFS owns the zed command.
Expand All @@ -167,6 +172,23 @@ export const resolveEditorCommand = Effect.fn("editor.resolveEditorCommand")(fun
}

if (preferBundle) candidates.push(...editor.commands);
if (toolbox) {
// Toolbox names a launch script `idea1`, `idea2`, ... while `idea` is taken, and keeps that
// name after the other install is removed. Try these only after every canonical candidate.
const { dir, suffix } = toolbox;
const entries = yield* fs.readDirectory(dir).pipe(Effect.orElseSucceed(() => []));
candidates.push(
...entries
.filter(
(entry) =>
entry.startsWith(command) &&
entry.endsWith(suffix) &&
/^\d+$/.test(entry.slice(command.length, entry.length - suffix.length)),
)
.sort((a, b) => a.length - b.length || a.localeCompare(b))
.map((entry) => path.join(dir, entry)),
);
}
const rejected = new Set<string>();
for (const candidate of candidates) {
const resolved = yield* resolveCommandPath(candidate, { env });
Expand Down
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.