diff --git a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java index 1edcc46b1..4d2d47915 100644 --- a/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java +++ b/app/src/main/java/io/xpipe/app/core/window/AppMainWindow.java @@ -171,9 +171,9 @@ public class AppMainWindow { } private static String createTitle() { - var t = LicenseProvider.get().licenseTitle(); + var t = LicenseProvider.get() != null ? LicenseProvider.get().licenseTitle() : new SimpleStringProperty("?"); var base = - String.format("XPipe %s (%s)", t.getValue(), AppProperties.get().getVersion()); + String.format("XPipe %s (%s)", t, AppProperties.get().getVersion()); var prefix = AppProperties.get().isStaging() ? "[Public Test Build, Not a proper release] " : ""; var dist = AppDistributionType.get(); if (dist == AppDistributionType.UNKNOWN) { diff --git a/app/src/main/java/io/xpipe/app/ext/ShellStore.java b/app/src/main/java/io/xpipe/app/ext/ShellStore.java index 980b31537..e02dd19f1 100644 --- a/app/src/main/java/io/xpipe/app/ext/ShellStore.java +++ b/app/src/main/java/io/xpipe/app/ext/ShellStore.java @@ -1,5 +1,6 @@ package io.xpipe.app.ext; +import io.xpipe.app.core.AppProperties; import io.xpipe.app.issue.ErrorEvent; import io.xpipe.core.process.ShellControl; import io.xpipe.core.process.StubShellControl; @@ -8,6 +9,11 @@ import io.xpipe.core.store.*; public interface ShellStore extends DataStore, FileSystemStore, ValidatableStore, SingletonSessionStore { default ShellControl getOrStartSession() throws Exception { + // For tests, the cache is not available + if (AppProperties.get().isTest()) { + return standaloneControl(); + } + var session = getSession(); if (session != null) { session.getShellControl().refreshRunningState(); diff --git a/app/src/main/java/io/xpipe/app/terminal/WindowsTerminalType.java b/app/src/main/java/io/xpipe/app/terminal/WindowsTerminalType.java index a0ec7f4f1..760cc41c7 100644 --- a/app/src/main/java/io/xpipe/app/terminal/WindowsTerminalType.java +++ b/app/src/main/java/io/xpipe/app/terminal/WindowsTerminalType.java @@ -153,7 +153,15 @@ public interface WindowsTerminalType extends ExternalTerminalType, TrackableTerm @Override public void launch(TerminalLaunchConfiguration configuration) throws Exception { checkProfile(); - super.launch(configuration); + + var inPath = LocalShell.getShell().view().findProgram("wt").isPresent(); + if (inPath) { + super.launch(configuration); + } else { + LocalShell.getShell() + .executeSimpleCommand( + CommandBuilder.of().addFile(getPath().toString()).add(toCommand(configuration))); + } } @Override @@ -166,6 +174,12 @@ public interface WindowsTerminalType extends ExternalTerminalType, TrackableTerm return WindowsTerminalType.toCommand(configuration); } + private Path getPath() { + var local = System.getenv("LOCALAPPDATA"); + return Path.of(local) + .resolve("Microsoft\\WindowsApps\\Microsoft.WindowsTerminal_8wekyb3d8bbwe\\wt.exe"); + } + @Override public Path getConfigFile() { var local = System.getenv("LOCALAPPDATA"); diff --git a/app/src/main/java/io/xpipe/app/util/DocumentationLink.java b/app/src/main/java/io/xpipe/app/util/DocumentationLink.java index 0bcd5f3c6..44e600977 100644 --- a/app/src/main/java/io/xpipe/app/util/DocumentationLink.java +++ b/app/src/main/java/io/xpipe/app/util/DocumentationLink.java @@ -30,6 +30,7 @@ public enum DocumentationLink { VMWARE("guide/vmware"), VNC("guide/vnc"), SSH("guide/ssh"), + SSH_MACS("guide/ssh#no-matching-mac-found"), KEEPASSXC("guide/password-manager#keepassxc"), PASSWORD_MANAGER("guide/password-manager"); diff --git a/dist/changelogs/16.0.md b/dist/changelogs/16.0.md index 483afb463..6f467a57d 100644 --- a/dist/changelogs/16.0.md +++ b/dist/changelogs/16.0.md @@ -77,3 +77,4 @@ The application window will now hide any unnecessary sidebars when being resized - Fix Windows terminal launch failing if default profile was set to launch as admin - Fix tailscale login check not opening website on Linux - Fix terminal connections failing to launch for some systems with a read-only file system +- Fix Windows Terminal launch failing if it was not added to the PATH diff --git a/ext/base/src/main/java/io/xpipe/ext/base/script/ScriptStoreSetup.java b/ext/base/src/main/java/io/xpipe/ext/base/script/ScriptStoreSetup.java index 0962c1a9e..f69b54c05 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/script/ScriptStoreSetup.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/script/ScriptStoreSetup.java @@ -38,26 +38,6 @@ public class ScriptStoreSetup { } } - var checkedPermissions = new AtomicReference(); - FailableFunction permissionCheck = (sc) -> { - if (checkedPermissions.get() != null) { - return checkedPermissions.get(); - } - - // If we don't have write permissions / it is a read-only file system, don't create scripts - if (sc.getOsType() == OsType.LINUX) { - var file = sc.getSystemTemporaryDirectory().join("xpipe-test"); - var test = sc.command(CommandBuilder.of().add("touch").addFile(file).add("&&", "rm").addFile(file)).executeAndCheck(); - if (!test) { - checkedPermissions.set(false); - return false; - } - } - - checkedPermissions.set(true); - return true; - }; - var initFlattened = flatten(enabledScripts).stream() .filter(store -> store.getStore().isInitScript()) .toList(); @@ -74,10 +54,6 @@ public class ScriptStoreSetup { pc.withInitSnippet(new ShellTerminalInitCommand() { @Override public Optional terminalContent(ShellControl shellControl) throws Exception { - if (!permissionCheck.apply(shellControl)) { - return Optional.empty(); - } - return Optional.ofNullable(s.getStore().assembleScriptChain(shellControl)); } @@ -94,10 +70,6 @@ public class ScriptStoreSetup { @Override public Optional terminalContent(ShellControl shellControl) throws Exception { - if (!permissionCheck.apply(shellControl)) { - return Optional.empty(); - } - if (dir == null) { dir = initScriptsDirectory(shellControl, bringFlattened); } diff --git a/gradle/gradle_scripts/local_junit_suite.gradle b/gradle/gradle_scripts/local_junit_suite.gradle index 989adaee7..db80871a8 100644 --- a/gradle/gradle_scripts/local_junit_suite.gradle +++ b/gradle/gradle_scripts/local_junit_suite.gradle @@ -21,6 +21,10 @@ testing { jvmArgs += ["-Xmx2g"] jvmArgs += jvmRunArgs + def exts = files(project.allExtensions.stream().map(p -> p.getTasksByName('jar', true)[0].outputs.files.singleFile).toList()); + classpath += exts + dependsOn(project.allExtensions.stream().map(p -> p.getTasksByName('jar', true)[0]).toList()) + systemProperty 'io.xpipe.app.fullVersion', "true" systemProperty 'io.xpipe.beacon.printDaemonOutput', "false" systemProperty 'io.xpipe.app.useVirtualThreads', "false" diff --git a/version b/version index db27362df..46f303c86 100644 --- a/version +++ b/version @@ -1 +1 @@ -16.0-40 +16.0-41