mirror of
https://github.com/xpipe-io/xpipe.git
synced 2025-04-17 09:43:37 +00:00
Rework [stage]
This commit is contained in:
parent
466f5d4a75
commit
c86b5ec8a4
8 changed files with 30 additions and 32 deletions
|
@ -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) {
|
||||
|
|
|
@ -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<ShellSession> {
|
||||
|
||||
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();
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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");
|
||||
|
||||
|
|
1
dist/changelogs/16.0.md
vendored
1
dist/changelogs/16.0.md
vendored
|
@ -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
|
||||
|
|
|
@ -38,26 +38,6 @@ public class ScriptStoreSetup {
|
|||
}
|
||||
}
|
||||
|
||||
var checkedPermissions = new AtomicReference<Boolean>();
|
||||
FailableFunction<ShellControl, Boolean, Exception> 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<String> 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<String> terminalContent(ShellControl shellControl) throws Exception {
|
||||
if (!permissionCheck.apply(shellControl)) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
if (dir == null) {
|
||||
dir = initScriptsDirectory(shellControl, bringFlattened);
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
2
version
2
version
|
@ -1 +1 @@
|
|||
16.0-40
|
||||
16.0-41
|
||||
|
|
Loading…
Add table
Reference in a new issue