mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-28 03:15:33 +02:00
Bug 314607 - [terminal][local] Launching a terminal also pops up the console view
This commit is contained in:
parent
d8f411c09d
commit
3d22920e84
2 changed files with 16 additions and 4 deletions
|
@ -42,7 +42,7 @@ import org.eclipse.ui.IWorkbenchWindow;
|
||||||
* mechanism.
|
* mechanism.
|
||||||
*
|
*
|
||||||
* @author Mirko Raner
|
* @author Mirko Raner
|
||||||
* @version $Revision: 1.1 $
|
* @version $Revision: 1.2 $
|
||||||
*/
|
*/
|
||||||
public class LocalTerminalStillRunningListener implements IWorkbenchListener {
|
public class LocalTerminalStillRunningListener implements IWorkbenchListener {
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@ public class LocalTerminalStillRunningListener implements IWorkbenchListener {
|
||||||
IPreferenceStore store = LocalTerminalActivator.getDefault().getPreferenceStore();
|
IPreferenceStore store = LocalTerminalActivator.getDefault().getPreferenceStore();
|
||||||
if (!store.getBoolean(LocalTerminalActivator.PREF_CONFIRM_TERMINATE_ON_SHUTDOWN)) {
|
if (!store.getBoolean(LocalTerminalActivator.PREF_CONFIRM_TERMINATE_ON_SHUTDOWN)) {
|
||||||
|
|
||||||
//return true;
|
return true;
|
||||||
}
|
}
|
||||||
ILaunchConfigurationType launchType;
|
ILaunchConfigurationType launchType;
|
||||||
String launchTypeID = LocalTerminalLaunchDelegate.LAUNCH_CONFIGURATION_TYPE_ID;
|
String launchTypeID = LocalTerminalLaunchDelegate.LAUNCH_CONFIGURATION_TYPE_ID;
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Mirko Raner - initial implementation for Eclipse Bug 196337
|
* Mirko Raner - initial implementation for Eclipse Bug 196337
|
||||||
|
* Mirko Raner - [314607] Launching a terminal also pops up the console view
|
||||||
**************************************************************************************************/
|
**************************************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.tm.internal.terminal.local.process;
|
package org.eclipse.tm.internal.terminal.local.process;
|
||||||
|
@ -50,6 +51,15 @@ import org.eclipse.debug.core.model.RuntimeProcess;
|
||||||
* <code>null</code>. After the launch is terminated it will appear in the Debug view with the
|
* <code>null</code>. After the launch is terminated it will appear in the Debug view with the
|
||||||
* terminated process as its child element. The exit value of the terminal process can also be seen
|
* terminated process as its child element. The exit value of the terminal process can also be seen
|
||||||
* in that view. <p>
|
* in that view. <p>
|
||||||
|
* {@link #getStreamsProxy()} will also return <code>null</code> during initialization of a
|
||||||
|
* {@link LocalTerminalProcess} object until after the
|
||||||
|
* {@link RuntimeProcess#RuntimeProcess(ILaunch, Process, String, Map) super constructor} invocation
|
||||||
|
* has been completed. This disables a code path that caused a Console view to pop up when the
|
||||||
|
* {@link org.eclipse.debug.core.model.IStreamMonitor IStreamMonitor} already contained data (like,
|
||||||
|
* for example, a shell's initial prompt) when the <code>ProcessConsoleManager</code> received an
|
||||||
|
* {@link org.eclipse.debug.core.ILaunchListener#launchChanged(ILaunch)} notification (which cannot
|
||||||
|
* be avoided). See <a href="https://bugs.eclipse.org/314607">https://bugs.eclipse.org/314607</a>
|
||||||
|
* for additional details. <p/>
|
||||||
*
|
*
|
||||||
* This solution for preventing standard consoles from being opened does certainly not deserve the
|
* This solution for preventing standard consoles from being opened does certainly not deserve the
|
||||||
* cleanliness award for straightforward coding, but at least it doesn't rely on internal API at
|
* cleanliness award for straightforward coding, but at least it doesn't rely on internal API at
|
||||||
|
@ -57,7 +67,7 @@ import org.eclipse.debug.core.model.RuntimeProcess;
|
||||||
* extension point as proposed in bug 242373 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=242373).
|
* extension point as proposed in bug 242373 (https://bugs.eclipse.org/bugs/show_bug.cgi?id=242373).
|
||||||
*
|
*
|
||||||
* @author Mirko Raner
|
* @author Mirko Raner
|
||||||
* @version $Revision: 1.1 $
|
* @version $Revision: 1.2 $
|
||||||
*/
|
*/
|
||||||
public final class LocalTerminalProcess extends RuntimeProcess {
|
public final class LocalTerminalProcess extends RuntimeProcess {
|
||||||
|
|
||||||
|
@ -66,6 +76,7 @@ public final class LocalTerminalProcess extends RuntimeProcess {
|
||||||
*/
|
*/
|
||||||
public final static String PROCESS_TYPE = "org.eclipse.tm.terminal.localProcess"; //$NON-NLS-1$
|
public final static String PROCESS_TYPE = "org.eclipse.tm.terminal.localProcess"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
private boolean enableStreamsProxy;
|
||||||
private boolean resetStreamsProxy;
|
private boolean resetStreamsProxy;
|
||||||
private PTY pty;
|
private PTY pty;
|
||||||
|
|
||||||
|
@ -80,6 +91,7 @@ public final class LocalTerminalProcess extends RuntimeProcess {
|
||||||
protected LocalTerminalProcess(ILaunch launch, Process process, String name, Map attributes) {
|
protected LocalTerminalProcess(ILaunch launch, Process process, String name, Map attributes) {
|
||||||
|
|
||||||
super(launch, process, name, setProcessType(attributes));
|
super(launch, process, name, setProcessType(attributes));
|
||||||
|
enableStreamsProxy = true;
|
||||||
LocalTerminalProcessRegistry.registerWithLaunch(launch, this);
|
LocalTerminalProcessRegistry.registerWithLaunch(launch, this);
|
||||||
launch.removeProcess(this);
|
launch.removeProcess(this);
|
||||||
}
|
}
|
||||||
|
@ -110,7 +122,7 @@ public final class LocalTerminalProcess extends RuntimeProcess {
|
||||||
*/
|
*/
|
||||||
public IStreamsProxy getStreamsProxy() {
|
public IStreamsProxy getStreamsProxy() {
|
||||||
|
|
||||||
if (resetStreamsProxy) {
|
if (resetStreamsProxy || !enableStreamsProxy) {
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue