mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-29 11:55:40 +02:00
Bug 348700 - [terminal] Regression: Terminal is unusable after "Disconnect"
This commit is contained in:
parent
51d802bdce
commit
164552f40e
1 changed files with 11 additions and 14 deletions
|
@ -28,6 +28,7 @@
|
||||||
* Anton Leherbauer (Wind River) - [335021] Middle mouse button copy/paste does not work with the terminal
|
* Anton Leherbauer (Wind River) - [335021] Middle mouse button copy/paste does not work with the terminal
|
||||||
* Max Stepanov (Appcelerator) - [339768] Fix ANSI code for PgUp / PgDn
|
* Max Stepanov (Appcelerator) - [339768] Fix ANSI code for PgUp / PgDn
|
||||||
* Pawel Piech (Wind River) - [333613] "Job found still running" after shutdown
|
* Pawel Piech (Wind River) - [333613] "Job found still running" after shutdown
|
||||||
|
* Martin Oberhuber (Wind River) - [348700] Terminal unusable after disconnect
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.tm.internal.terminal.emulator;
|
package org.eclipse.tm.internal.terminal.emulator;
|
||||||
|
|
||||||
|
@ -347,9 +348,14 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
public void disconnectTerminal() {
|
public void disconnectTerminal() {
|
||||||
Logger.log("entered."); //$NON-NLS-1$
|
Logger.log("entered."); //$NON-NLS-1$
|
||||||
|
|
||||||
|
//Disconnect the remote side first
|
||||||
|
if (getState()!=TerminalState.CLOSED) {
|
||||||
|
if(getTerminalConnector()!=null) {
|
||||||
|
getTerminalConnector().disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//Ensure that a new Job can be started; then clean up old Job.
|
//Ensure that a new Job can be started; then clean up old Job.
|
||||||
//TODO not sure whether the fInputStream needs to be cleaned too,
|
|
||||||
//or whether the Job could actually cancel in case the fInputStream is closed.
|
|
||||||
Job job;
|
Job job;
|
||||||
synchronized(this) {
|
synchronized(this) {
|
||||||
job = fJob;
|
job = fJob;
|
||||||
|
@ -358,22 +364,13 @@ public class VT100TerminalControl implements ITerminalControlForText, ITerminalC
|
||||||
if (job!=null) {
|
if (job!=null) {
|
||||||
job.cancel();
|
job.cancel();
|
||||||
// Join job to avoid leaving job running after workbench shutdown (333613).
|
// Join job to avoid leaving job running after workbench shutdown (333613).
|
||||||
|
// Interrupt to be fast enough; cannot close fInputStream since it is re-used (bug 348700).
|
||||||
|
Thread t = job.getThread();
|
||||||
|
if(t!=null) t.interrupt();
|
||||||
try {
|
try {
|
||||||
// The Job will check its cancel status after 500msec latest. But we still
|
|
||||||
// Interrupt the Job, such that it can join fast enough during Workbench shutdown (bug 333613).
|
|
||||||
// TODO closing fInputStream may seem more clean but causes problems (bug 348700).
|
|
||||||
Thread t = job.getThread();
|
|
||||||
if(t!=null) t.interrupt();
|
|
||||||
job.join();
|
job.join();
|
||||||
} catch (InterruptedException e) {}
|
} catch (InterruptedException e) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getState()==TerminalState.CLOSED) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if(getTerminalConnector()!=null) {
|
|
||||||
getTerminalConnector().disconnect();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
Loading…
Add table
Reference in a new issue