authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-12 19:35:41-08:00
committergravatar for jmarminge@gmail.comJulius Marminge <jmarminge@gmail.com> 2026-02-12 19:36:40-08:00
log854068dc565bdbe8b9e7c6183eb4914674816fc3
treee9fd144efe818c3a7964c5480670090bca2d131a
parentccaa58e393d94226ec5e63a5dd1d51b1071d2821

lint


1 files changed, 7 insertions(+), 6 deletions(-)

apps/web/src/terminal-links.ts+7-6
...@@ -115,14 +115,18 @@ function inferHomeFromCwd(cwd: string): string | undefined {...@@ -115,14 +115,18 @@ function inferHomeFromCwd(cwd: string): string | undefined {
115 return undefined;115 return undefined;
116}116}
117117
118function splitPathAndPosition(value: string): { path: string; line?: string; column?: string } {118function splitPathAndPosition(value: string): {
119 path: string;
120 line: string | undefined;
121 column: string | undefined;
122} {
119 let path = value;123 let path = value;
120 let column: string | undefined;124 let column: string | undefined;
121 let line: string | undefined;125 let line: string | undefined;
122126
123 const columnMatch = path.match(/:(\d+)$/);127 const columnMatch = path.match(/:(\d+)$/);
124 if (!columnMatch?.[1]) {128 if (!columnMatch?.[1]) {
125 return { path };129 return { path, line: undefined, column: undefined };
126 }130 }
127131
128 column = columnMatch[1];132 column = columnMatch[1];
...@@ -176,10 +180,7 @@ export function resolvePathLinkTarget(rawPath: string, cwd: string): string {...@@ -176,10 +180,7 @@ export function resolvePathLinkTarget(rawPath: string, cwd: string): string {
176}180}
177181
178export function preferredTerminalEditor(): EditorId {182export function preferredTerminalEditor(): EditorId {
179 const fallback =183 const fallback = EDITORS.find((editor) => editor.command)?.id ?? EDITORS[0]?.id ?? "cursor";
180 EDITORS.find((editor) => editor.command)?.id ??
181 EDITORS[0]?.id ??
182 "cursor";
183184
184 if (typeof window === "undefined") {185 if (typeof window === "undefined") {
185 return fallback;186 return fallback;