mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 09:00:26 +00:00
Adjust terminal hierarchies
This commit is contained in:
parent
27d38c7030
commit
dd5881f9ad
3 changed files with 26 additions and 0 deletions
|
@ -803,6 +803,12 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
|
|||
}
|
||||
};
|
||||
ExternalTerminalType MACOS_TERMINAL = new MacOsType("app.macosTerminal", "Terminal") {
|
||||
|
||||
@Override
|
||||
public int getProcessHierarchyOffset() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supportsTabs() {
|
||||
return false;
|
||||
|
@ -828,6 +834,12 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
|
|||
}
|
||||
};
|
||||
ExternalTerminalType ITERM2 = new MacOsType("app.iterm2", "iTerm") {
|
||||
|
||||
@Override
|
||||
public int getProcessHierarchyOffset() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getWebsite() {
|
||||
return "https://iterm2.com/";
|
||||
|
@ -859,6 +871,11 @@ public interface ExternalTerminalType extends PrefsChoiceValue {
|
|||
};
|
||||
ExternalTerminalType WARP = new MacOsType("app.warp", "Warp") {
|
||||
|
||||
@Override
|
||||
public int getProcessHierarchyOffset() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getWebsite() {
|
||||
return "https://www.warp.dev/";
|
||||
|
|
|
@ -154,6 +154,11 @@ public interface KittyTerminalType extends ExternalTerminalType {
|
|||
super("app.kitty", "kitty");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getProcessHierarchyOffset() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void launch(LaunchConfiguration configuration) throws Exception {
|
||||
// We use the absolute path to force the usage of macOS netcat
|
||||
|
|
|
@ -132,6 +132,10 @@ public class TerminalView {
|
|||
}
|
||||
|
||||
var off = trackableTerminalType.getProcessHierarchyOffset();
|
||||
if (AppPrefs.get().enableTerminalLogging().get() && OsType.getLocal() != OsType.WINDOWS) {
|
||||
off += 2;
|
||||
}
|
||||
|
||||
var current = Optional.of(shell);
|
||||
for (int i = 0; i < 1 + off; i++) {
|
||||
current = current.flatMap(processHandle -> processHandle.parent());
|
||||
|
|
Loading…
Reference in a new issue