Add PowerShell as a selectable shell in the distro dropdown
This commit is contained in:
parent
29b15f19c1
commit
234a0b74a1
2 changed files with 45 additions and 21 deletions
10
src/App.tsx
10
src/App.tsx
|
|
@ -49,6 +49,9 @@ import "./lib/layout/Gutter.css";
|
|||
|
||||
const LEGACY_STORAGE_KEY = "tiletopia.tree.v1";
|
||||
const SAVE_DEBOUNCE_MS = 500;
|
||||
/** Sentinel "distro" the backend recognises to spawn powershell.exe instead
|
||||
* of wsl.exe. Must match `POWERSHELL_DISTRO` in `src-tauri/src/pty.rs`. */
|
||||
const POWERSHELL_DISTRO = "PowerShell";
|
||||
|
||||
function isInteractiveDistro(name: string): boolean {
|
||||
return !name.toLowerCase().startsWith("docker-desktop");
|
||||
|
|
@ -100,11 +103,14 @@ export default function App() {
|
|||
let resolvedDefault: string | undefined;
|
||||
try {
|
||||
resolvedDistros = await listDistros();
|
||||
resolvedDefault =
|
||||
resolvedDistros.find(isInteractiveDistro) ?? resolvedDistros[0];
|
||||
} catch (e) {
|
||||
console.warn("list_distros failed:", e);
|
||||
}
|
||||
// Append PowerShell as a pseudo-distro so it appears in the titlebar
|
||||
// default-picker and the per-pane dropdown.
|
||||
resolvedDistros = [...resolvedDistros, POWERSHELL_DISTRO];
|
||||
resolvedDefault =
|
||||
resolvedDistros.find(isInteractiveDistro) ?? resolvedDistros[0];
|
||||
|
||||
if (cancelled) return;
|
||||
if (loaded) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue