mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +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 =
|
||||
fs.getShell().get().getInitCommands().size();
|
||||
ProcessControlProvider.get().withDefaultScripts(fs.getShell().get());
|
||||
|
||||
fs.getShell().get().onKill(() -> {
|
||||
browserModel.closeFileSystemAsync(this);
|
||||
});
|
||||
}
|
||||
fs.open();
|
||||
this.fileSystem = fs;
|
||||
|
|
|
@ -62,7 +62,7 @@ public interface ShellControl extends ProcessControl {
|
|||
}
|
||||
|
||||
default <T extends ShellStoreState> ShellControl withShellStateFail(StatefulDataStore<T> store) {
|
||||
return onFail(shellControl -> {
|
||||
return onStartupFail(shellControl -> {
|
||||
var s = store.getState();
|
||||
s.setRunning(false);
|
||||
store.setState(s);
|
||||
|
@ -71,7 +71,9 @@ public interface ShellControl extends ProcessControl {
|
|||
|
||||
ShellControl onExit(Consumer<ShellControl> pc);
|
||||
|
||||
ShellControl onFail(Consumer<Throwable> t);
|
||||
ShellControl onKill(Runnable pc);
|
||||
|
||||
ShellControl onStartupFail(Consumer<Throwable> t);
|
||||
|
||||
ShellControl withExceptionConverter(ExceptionConverter converter);
|
||||
|
||||
|
|
Loading…
Reference in a new issue