Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions QuickShell.Raycast/src/components/workspace-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,8 @@ export default function WorkspaceForm({
terminal: selectedTerminal?.terminal ?? "default",
wtProfile: selectedTerminal?.wtProfile ?? null,
isPinned: formValues.isPinned,
runAsAdmin: isMacPlatform() ? false : formValues.runAsAdmin,
launches: isMacPlatform() ? launches.map((launch) => ({ ...launch, runAsAdmin: false })) : launches,
runAsAdmin: isMacPlatform() ? initialWorkspace.runAsAdmin : formValues.runAsAdmin,
launches,
companions,
devServerUrl: formValues.devServerUrl,
openDevServerOnLaunch: formValues.openDevServerOnLaunch,
Expand Down
7 changes: 5 additions & 2 deletions QuickShell.Raycast/src/lib/import-export.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createStableId, isStableWorkspaceId } from "./ids";
import { migrateStoredData } from "./migration";
import type { LayoutEntry, StoredData, Workspace } from "./schema";
import { createEmptyStoredData } from "./schema";
import { SCHEMA_VERSION, createEmptyStoredData } from "./schema";
import { createIngressSecurity } from "./security";

type UnknownRecord = Record<string, unknown>;
Expand Down Expand Up @@ -80,6 +80,9 @@ export function importParsedPayload(parsed: unknown, existing?: StoredData): Imp

// CmdPal / Core layout envelope: { version, entries: [ shortcut | { Workspace } | separator ] }
if (Array.isArray(record.entries)) {
if (typeof record.version === "number" && record.version > SCHEMA_VERSION) {
throw new Error(`Unsupported Quick Shell data version: ${record.version}`);
}
return importCmdPalLayoutEnvelope(record.entries, existing);
}

Expand Down Expand Up @@ -213,7 +216,7 @@ function mergeImportedData(imported: StoredData, existing?: StoredData): ImportR
...(base.layoutEntries ?? []),
// Prefer remapped imported layout (keeps CmdPal separators). Fall back to
// appending workspace rows when the payload had no layout entries.
...(remappedImportLayout.length > 0
...(remappedImportLayout.some((entry) => entry.type === "workspace")
? remappedImportLayout
: newlyImported.map((workspace) => ({ type: "workspace" as const, workspaceId: workspace.id }))),
];
Expand Down
8 changes: 6 additions & 2 deletions QuickShell.Raycast/src/lib/mac-launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export type MacLaunchInvocation = {
displayName: string;
};

export type MacLaunchEntryGroup = {
type MacLaunchEntryGroup = {
hostId: MacTerminalHostId;
entries: LaunchPlanEntry[];
};
Expand Down Expand Up @@ -90,9 +90,13 @@ export function groupMacLaunchEntries(

const groups: MacLaunchEntryGroup[] = [];
const groupIndexByHost = new Map<MacTerminalHostId, number>();
let previousHostId: MacTerminalHostId | undefined;

for (const entry of entries) {
const hostId = resolveMacTerminalHostId(entry.launch.terminal, settings);
const hostId = entry.launch.terminal?.trim().toLowerCase() === "same-as-previous" && previousHostId
? previousHostId
: resolveMacTerminalHostId(entry.launch.terminal, settings);
previousHostId = hostId;
const existingIndex = groupIndexByHost.get(hostId);
if (existingIndex !== undefined) {
groups[existingIndex].entries.push(entry);
Expand Down
2 changes: 1 addition & 1 deletion QuickShell.Raycast/src/lib/storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,7 @@ export class QuickShellStorage {
clearTimeout(this.recentWriteTimer);
}
this.recentWriteTimer = setTimeout(() => {
void this.flushRecentWrites().catch(() => {
void writeLockContext.run(undefined, () => this.flushRecentWrites()).catch(() => {
this.recentWriteDirty = true;
});
}, RECENT_WRITE_DEBOUNCE_MS);
Expand Down
13 changes: 7 additions & 6 deletions QuickShell.Raycast/src/lib/workspace-transfer-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,15 @@ async function pickWindowsTransferJsonPath(kind: DialogKind): Promise<string | n
if (fromStdout) {
return fromStdout;
}
// Any thrown pwsh error with no path (ENOENT or dialog/runtime failure) should fall
// through to Windows PowerShell 5.1. Cancel is empty stdout on success above, or empty
// stdout on a thrown error here — both should try the next shell before giving up.
if (shell === "powershell.exe") {
console.error("Windows transfer dialog script failed:", error);
const errno = (error as NodeJS.ErrnoException | undefined)?.code;
if (errno === "ENOENT" && shell === "pwsh") {
continue;
}
// A cancelled WinForms dialog exits with its established non-zero status and no output.
if (shell === "powershell.exe" && errno === 1) {
return null;
}
throw error;
}
}

Expand Down Expand Up @@ -202,7 +204,6 @@ async function pickMacTransferJsonPath(kind: DialogKind): Promise<string | null>
if (fromStdout) {
return fromStdout;
}
console.error("macOS transfer dialog script failed:", error);
return null;
}
}
Expand Down
Loading