Assure "Process completed" string is written to terminal before session is finished

This commit is contained in:
agnostic-apollo
2021-04-12 14:49:49 +05:00
parent f888f35e35
commit a95e187b25

View File

@@ -340,7 +340,6 @@ public final class TerminalSession extends TerminalOutput {
if (msg.what == MSG_PROCESS_EXITED) {
int exitCode = (Integer) msg.obj;
cleanupResources(exitCode);
mClient.onSessionFinished(TerminalSession.this);
String exitDescription = "\r\n[Process completed";
if (exitCode > 0) {
@@ -355,6 +354,8 @@ public final class TerminalSession extends TerminalOutput {
byte[] bytesToWrite = exitDescription.getBytes(StandardCharsets.UTF_8);
mEmulator.append(bytesToWrite, bytesToWrite.length);
notifyScreenUpdate();
mClient.onSessionFinished(TerminalSession.this);
}
}