mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Terminated console should not be counted (PY-5129).
This commit is contained in:
+14
-8
@@ -144,16 +144,22 @@ public abstract class AbstractConsoleRunnerWithHistory<T extends LanguageConsole
|
||||
return dom.contains(consoleTitle);
|
||||
}
|
||||
});
|
||||
int max = consoles.size() > 0 ? 1 : 0;
|
||||
int max = 0;
|
||||
for (RunContentDescriptor dsc : consoles) {
|
||||
try {
|
||||
int num = Integer.parseInt(dsc.getDisplayName().substring(consoleTitle.length() + 1, dsc.getDisplayName().length() - 1));
|
||||
if (num > max) {
|
||||
max = num;
|
||||
ProcessHandler handler = dsc.getProcessHandler();
|
||||
if (handler != null && !handler.isProcessTerminated()) {
|
||||
if (max == 0) {
|
||||
max = 1;
|
||||
}
|
||||
try {
|
||||
int num = Integer.parseInt(dsc.getDisplayName().substring(consoleTitle.length() + 1, dsc.getDisplayName().length() - 1));
|
||||
if (num > max) {
|
||||
max = num;
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
//skip
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
//skip
|
||||
}
|
||||
}
|
||||
if (max >= 1) {
|
||||
|
||||
Reference in New Issue
Block a user