cmd as default windows terminal
This commit is contained in:
parent
1c24c84537
commit
bd94fc6dc3
@ -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 {
|
pb = new ProcessBuilder("cmd.exe", "/c", "start", "cmd.exe");
|
||||||
// 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");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} 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());
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user