Skip to content
Merged
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
17 changes: 11 additions & 6 deletions standalone/scripts/dogfood.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,17 @@ if [[ "${1:-}" == "--install" ]]; then
echo "After that, 'dogfood:standalone --install' will work from then on."
exit 1
fi
# Wipe everything except uninstall.exe (managed by NSIS), then copy
TMP_UNINSTALL="$(mktemp)"
cp "$INSTALL_DIR/uninstall.exe" "$TMP_UNINSTALL"
rm -rf "$INSTALL_DIR"
mkdir -p "$INSTALL_DIR"
mv "$TMP_UNINSTALL" "$INSTALL_DIR/uninstall.exe"
# If a previous run left an orphaned sidecar/MouseTerm holding files in
# the install dir, kill it before we try to overwrite anything.
for exe in mouseterm.exe node.exe; do
taskkill //F //T //IM "$exe" >/dev/null 2>&1 || true
done
# Wipe install-dir contents except uninstall.exe (managed by NSIS).
# We delete *contents* rather than the directory itself so we don't trip
# over Windows' "directory in use" if a process has it as cwd or loaded
# an exe image from it.
find "$INSTALL_DIR" -mindepth 1 -maxdepth 1 -not -name 'uninstall.exe' \
-exec rm -rf {} +
cp "$RELEASE_DIR/mouseterm.exe" "$INSTALL_DIR/"
cp "$RELEASE_DIR/node.exe" "$INSTALL_DIR/"
cp -r "$RELEASE_DIR/_up_/" "$INSTALL_DIR/_up_/"
Expand Down
15 changes: 15 additions & 0 deletions standalone/sidecar/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,18 @@ rl.on('line', (line) => {

rl.on('close', () => { mgr.killAll(); process.exit(0); });
process.on('SIGTERM', () => { mgr.killAll(); process.exit(0); });

// Watchdog: if the Tauri host crashes or is force-killed, stdin EOF isn't
// always delivered (esp. on Windows), leaving us as an orphan that locks
// the install directory. Poll the parent PID and self-exit when it's gone.
const parentPid = process.ppid;
if (parentPid && parentPid > 0) {
setInterval(() => {
try {
process.kill(parentPid, 0);
} catch {
mgr.killAll();
process.exit(0);
}
}, 2000).unref();
}
4 changes: 2 additions & 2 deletions standalone/src/AppBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ function ShellDropdown({ shells }: { shells: ShellEntry[] }) {
className="absolute left-0 top-full z-50 mt-1 w-max flex-col py-1"
>
{shells.map((shell) => {
const isSelected = shell.path === selected?.path;
const isSelected = shell.name === selected?.name;
return (
<button
key={shell.path}
key={shell.name}
role="menuitemradio"
aria-checked={isSelected}
className="flex w-full items-center gap-2 whitespace-nowrap px-3 py-1.5 text-left text-xs text-foreground transition-colors hover:bg-surface-raised"
Expand Down
Loading