cmd as default windows terminal

This commit is contained in:
rdavidek 2026-01-25 21:59:42 +01:00
parent 1c24c84537
commit bd94fc6dc3

View File

@ -2138,21 +2138,8 @@ public class MainWindow extends JFrame {
ProcessBuilder pb = null; ProcessBuilder pb = null;
if (osName.contains("win")) { if (osName.contains("win")) {
// Windows - try Windows Terminal first, then PowerShell, then cmd // Windows - open cmd.exe
try {
// Try to use Windows Terminal if available
new ProcessBuilder("wt.exe", "-d", currentDir.getAbsolutePath()).start();
return;
} catch (Exception e1) {
try {
// Fallback to PowerShell
new ProcessBuilder("powershell.exe").directory(currentDir).start();
return;
} catch (Exception e2) {
// Final fallback to cmd
pb = new ProcessBuilder("cmd.exe", "/c", "start", "cmd.exe"); pb = new ProcessBuilder("cmd.exe", "/c", "start", "cmd.exe");
}
}
} else if (osName.contains("mac")) { } else if (osName.contains("mac")) {
// macOS // macOS
pb = new ProcessBuilder("open", "-a", "Terminal", currentDir.getAbsolutePath()); pb = new ProcessBuilder("open", "-a", "Terminal", currentDir.getAbsolutePath());