mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 09:00:26 +00:00
Rework shell exit listener to close file browser tabs
This commit is contained in:
parent
770c9eb309
commit
c2ac2481e4
2 changed files with 8 additions and 2 deletions
|
@ -394,6 +394,10 @@ public final class OpenFileSystemModel {
|
||||||
this.customScriptsStartIndex =
|
this.customScriptsStartIndex =
|
||||||
fs.getShell().get().getInitCommands().size();
|
fs.getShell().get().getInitCommands().size();
|
||||||
ProcessControlProvider.get().withDefaultScripts(fs.getShell().get());
|
ProcessControlProvider.get().withDefaultScripts(fs.getShell().get());
|
||||||
|
|
||||||
|
fs.getShell().get().onKill(() -> {
|
||||||
|
browserModel.closeFileSystemAsync(this);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
fs.open();
|
fs.open();
|
||||||
this.fileSystem = fs;
|
this.fileSystem = fs;
|
||||||
|
|
|
@ -62,7 +62,7 @@ public interface ShellControl extends ProcessControl {
|
||||||
}
|
}
|
||||||
|
|
||||||
default <T extends ShellStoreState> ShellControl withShellStateFail(StatefulDataStore<T> store) {
|
default <T extends ShellStoreState> ShellControl withShellStateFail(StatefulDataStore<T> store) {
|
||||||
return onFail(shellControl -> {
|
return onStartupFail(shellControl -> {
|
||||||
var s = store.getState();
|
var s = store.getState();
|
||||||
s.setRunning(false);
|
s.setRunning(false);
|
||||||
store.setState(s);
|
store.setState(s);
|
||||||
|
@ -71,7 +71,9 @@ public interface ShellControl extends ProcessControl {
|
||||||
|
|
||||||
ShellControl onExit(Consumer<ShellControl> pc);
|
ShellControl onExit(Consumer<ShellControl> pc);
|
||||||
|
|
||||||
ShellControl onFail(Consumer<Throwable> t);
|
ShellControl onKill(Runnable pc);
|
||||||
|
|
||||||
|
ShellControl onStartupFail(Consumer<Throwable> t);
|
||||||
|
|
||||||
ShellControl withExceptionConverter(ExceptionConverter converter);
|
ShellControl withExceptionConverter(ExceptionConverter converter);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue