diff options
author | Paul Pazderski | 2019-03-16 09:59:24 +0000 |
---|---|---|
committer | Paul Pazderski | 2019-10-13 12:03:18 +0000 |
commit | 154876b4fe661e138d81eebed0fe2e41da7da86a (patch) | |
tree | 3cef61df917d6c7c1533eec95f724bcd0fa408f1 /org.eclipse.debug.ui/ui/org | |
parent | 7d66945dc54589ce4d538434d0c9fea5f272746c (diff) | |
download | eclipse.platform.debug-154876b4fe661e138d81eebed0fe2e41da7da86a.tar.gz eclipse.platform.debug-154876b4fe661e138d81eebed0fe2e41da7da86a.tar.xz eclipse.platform.debug-154876b4fe661e138d81eebed0fe2e41da7da86a.zip |
Bug 552015 - [console] Streams closed notification send to late if inputI20191013-1800
is connected to file
If process input is connected to file the 'all streams are closed'
notification was not send on process termination but later on console
removal.
Change-Id: I83a732e1c876d9c15b7274159c18dc7723ef5143
Signed-off-by: Paul Pazderski <paul-eclipse@ppazderski.de>
Diffstat (limited to 'org.eclipse.debug.ui/ui/org')
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java | 26 | ||||
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java | 5 |
2 files changed, 26 insertions, 5 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java index 4c8d38382..fa46e9bd9 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsole.java @@ -11,6 +11,7 @@ * Contributors: * IBM Corporation - initial API and implementation * Paul Pazderski - Bug 545769: fixed rare UTF-8 character corruption bug + * Paul Pazderski - Bug 552015: console finished signaled to late if input is connected to file *******************************************************************************/ package org.eclipse.debug.internal.ui.views.console; @@ -104,6 +105,16 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe private IConsoleColorProvider fColorProvider; + /** + * The input stream which can supply user input in console to the system process + * stdin. + */ + private IOConsoleInputStream fUserInput; + /** + * The stream connected to the system processe's stdin. May be the + * <i>fUserInput</i> stream to supply user input or a FileInputStream to supply + * input from a file. + */ private volatile InputStream fInput; private FileOutputStream fFileOutputStream; @@ -114,14 +125,18 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe private boolean fStreamsClosed = false; /** - * Proxy to a console document + * Create process console with default encoding. + * + * @param process the process to associate with this console + * @param colorProvider the colour provider for this console */ public ProcessConsole(IProcess process, IConsoleColorProvider colorProvider) { this(process, colorProvider, null); } /** - * Constructor + * Create process console. + * * @param process the process to associate with this console * @param colorProvider the colour provider for this console * @param encoding the desired encoding for this console @@ -129,6 +144,7 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe public ProcessConsole(IProcess process, IConsoleColorProvider colorProvider, String encoding) { super(IInternalDebugCoreConstants.EMPTY_STRING, IDebugUIConstants.ID_PROCESS_CONSOLE_TYPE, null, encoding, true); fProcess = process; + fUserInput = getInputStream(); ILaunchConfiguration configuration = process.getLaunch().getLaunchConfiguration(); String file = null; @@ -421,6 +437,12 @@ public class ProcessConsole extends IOConsole implements IConsole, IDebugEventSe fInput.close(); } catch (IOException e) { } + if (fInput != fUserInput) { + try { + fUserInput.close(); + } catch (IOException e) { + } + } fStreamsClosed = true; } diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java index 1fd65d468..e30a6fc11 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/IDebugUIConstants.java @@ -966,9 +966,8 @@ public interface IDebugUIConstants { String ATTR_CAPTURE_IN_CONSOLE = PLUGIN_ID + ".ATTR_CONSOLE_OUTPUT_ON"; //$NON-NLS-1$ /** - * Launch configuration boolean attribute specifying whether input for the - * launched process will be captured from file. Default value is - * <code>null</code>. + * Launch configuration attribute to specifying a file whose content is supplied + * to the launched process input stream. Default value is <code>null</code>. * * @since 3.11 */ |