Skip to content

Instantly share code, notes, and snippets.

@jpospychala
Created December 7, 2012 13:36
Show Gist options
  • Save jpospychala/4233317 to your computer and use it in GitHub Desktop.
Save jpospychala/4233317 to your computer and use it in GitHub Desktop.
eltpatch
### Eclipse Workspace Patch 1.0
#P com.google.eclipse.elt.pty
diff --git utils/com/google/eclipse/elt/pty/util/Processes.java utils/com/google/eclipse/elt/pty/util/Processes.java
index 70cc4c3..16b1e29 100644
--- utils/com/google/eclipse/elt/pty/util/Processes.java
+++ utils/com/google/eclipse/elt/pty/util/Processes.java
@@ -1,14 +1,15 @@
package com.google.eclipse.elt.pty.util;
-import org.eclipse.cdt.utils.pty.PTY;
-import org.eclipse.cdt.utils.spawner.ProcessFactory;
-
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
+
+import org.eclipse.cdt.utils.pty.Terminal;
+import org.eclipse.cdt.utils.pty.TerminalFactory;
+import org.eclipse.cdt.utils.spawner.ProcessFactory;
/**
* Utility methods related to processes.
@@ -24,9 +25,10 @@
*/
public static Process executeInPty(
String[] command, Map<String, String> environment, File workingDirectory) throws IOException {
- PTY pty = new PTY(true);
ProcessFactory processFactory = ProcessFactory.getFactory();
- return processFactory.exec(command, toArray(environment), workingDirectory, pty);
+ TerminalFactory tfactory = TerminalFactory.getFactory();
+ Terminal pty = tfactory.createTerminal(false);
+ return processFactory.exec(command, toArray(environment), workingDirectory, pty);
}
private static String[] toArray(Map<String, String> environmentMap) {
diff --git utils/org/eclipse/cdt/utils/pty/PTY.java utils/org/eclipse/cdt/utils/pty/PTY.java
new file mode 100644
index 0000000..b410a02
--- /dev/null
+++ utils/org/eclipse/cdt/utils/pty/PTY.java
@@ -0,0 +1,149 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2010 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.cdt.utils.pty;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+import com.google.eclipse.elt.pty.PtyPlugin;
+
+/**
+ * PTY - pseudo terminal support.
+ */
+public class PTY implements Terminal {
+ static final String LIBRARY_NAME = "gpty";
+
+ final boolean console;
+ String slave;
+ PTYInputStream in;
+ PTYOutputStream out;
+ /*
+ * NOTE: Field is accessed by the native layer. Do not refactor!
+ */
+ int master;
+
+ private static boolean hasPTY;
+ private static boolean setTerminalSizeErrorAlreadyLogged;
+
+ /**
+ * The master fd is used on two streams. We need to wrap the fd so that when stream.close() is called the other stream
+ * is disabled.
+ */
+ public class MasterFD {
+ public int getFD() {
+ return master;
+ }
+
+ void setFD(int fd) {
+ master = fd;
+ }
+ }
+
+ /**
+ * Create PTY for use with Eclipse console. Identical to {@link PTY#PTY(boolean) PTY(true)}.
+ * @throws IOException if something goes wrong.
+ */
+ public PTY() throws IOException {
+ this(true);
+ }
+
+ /**
+ * Create pseudo-terminal.
+ *
+ * <p>
+ * The provided flag indicates whether the pseudo terminal is used with the interactive Eclipse console:
+ * <ul>
+ * <li>If {@code true} the terminal is configured with no echo and stderr is redirected to a pipe instead of the
+ * PTY.</li>
+ * <li>If {@code false} the terminal is configured with echo and stderr is connected to the PTY. This mode is
+ * best suited for use with a proper terminal emulation. Note that this mode might not be supported on all platforms.
+ * Known platforms which support this mode are: <code>linux-x86</code>, <code>linux-x86_64</code>,
+ * <code>solaris-sparc</code>, <code>macosx</code>.</li>
+ * </ul>
+ * </p>
+ *
+ * @param console whether terminal is used with Eclipse console
+ * @throws IOException if the PTY could not be created
+ * @since 5.2
+ */
+ public PTY(boolean console) throws IOException {
+ this.console = console;
+
+ if (hasPTY) {
+ slave = openMaster(console);
+ }
+
+ if (slave == null) {
+ throw new IOException(PtyPlugin.getResourceString("Util.exception.cannotCreatePty"));
+ }
+
+ in = new PTYInputStream(new MasterFD());
+ out = new PTYOutputStream(new MasterFD());
+ }
+
+ public String getSlaveName() {
+ return slave;
+ }
+
+ public MasterFD getMasterFD() {
+ return new MasterFD();
+ }
+
+ /**
+ * @return whether this pseudo terminal is for use with the Eclipse console.
+ */
+ public final boolean isConsole() {
+ return console;
+ }
+
+ public OutputStream getOutputStream() {
+ return out;
+ }
+
+ public InputStream getInputStream() {
+ return in;
+ }
+
+ /**
+ * Change terminal window size to given width and height.
+ * <p>
+ * This should only be used when the pseudo terminal is configured for use with a terminal emulation, i.e. when
+ * {@link #isConsole()} returns {@code false}.
+ * </p>
+ * <p>
+ * <strong>Note:</strong> This method may not be supported on all platforms. Known platforms which support this method
+ * are: {@code linux-x86}, {@code linux-x86_64}, {@code solaris-sparc}, {@code macosx}.
+ * </p>
+ * @param width the given width.
+ * @param height the given height.
+ */
+ public final void setTerminalSize(int width, int height) {
+ try {
+ change_window_size(master, width, height);
+ } catch (UnsatisfiedLinkError e) {
+ if (!setTerminalSizeErrorAlreadyLogged) {
+ setTerminalSizeErrorAlreadyLogged = true;
+ PtyPlugin.log(PtyPlugin.getResourceString("Util.exception.cannotSetTerminalSize"), e);
+ }
+ }
+ }
+
+ public static boolean isSupported() {
+ return false; //hasPTY;
+ }
+
+ native String openMaster(boolean console);
+
+ native int change_window_size(int fdm, int width, int height);
+
+ static {
+ System.loadLibrary(LIBRARY_NAME);
+ hasPTY = true;
+ }
+}
diff --git utils/org/eclipse/cdt/utils/pty/SoftTerminal.java utils/org/eclipse/cdt/utils/pty/SoftTerminal.java
new file mode 100644
index 0000000..6edacea
--- /dev/null
+++ utils/org/eclipse/cdt/utils/pty/SoftTerminal.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2002, 2010 QNX Software Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+package org.eclipse.cdt.utils.pty;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+
+/**
+ * PTY - pseudo terminal support.
+ */
+public class SoftTerminal implements Terminal {
+
+ final boolean console;
+ String slave;
+ InputStream in;
+ OutputStream out;
+ public int master;
+
+ /**
+ * The master fd is used on two streams. We need to wrap the fd so that when stream.close() is called the other stream
+ * is disabled.
+ */
+ public class MasterFD {
+ public int getFD() {
+ return master;
+ }
+
+ void setFD(int fd) {
+ master = fd;
+ }
+ }
+
+ /**
+ * Create PTY for use with Eclipse console. Identical to {@link PTY#PTY(boolean) PTY(true)}.
+ * @throws IOException if something goes wrong.
+ */
+
+ /**
+ * Create pseudo-terminal.
+ *
+ * <p>
+ * The provided flag indicates whether the pseudo terminal is used with the interactive Eclipse console:
+ * <ul>
+ * <li>If {@code true} the terminal is configured with no echo and stderr is redirected to a pipe instead of the
+ * PTY.</li>
+ * <li>If {@code false} the terminal is configured with echo and stderr is connected to the PTY. This mode is
+ * best suited for use with a proper terminal emulation. Note that this mode might not be supported on all platforms.
+ * Known platforms which support this mode are: <code>linux-x86</code>, <code>linux-x86_64</code>,
+ * <code>solaris-sparc</code>, <code>macosx</code>.</li>
+ * </ul>
+ * </p>
+ *
+ * @param console whether terminal is used with Eclipse console
+ * @throws IOException if the PTY could not be created
+ * @since 5.2
+ */
+ public SoftTerminal(boolean console) {
+ this.console = console;
+
+ slave = "slave";
+ }
+
+ public String getSlaveName() {
+ return slave;
+ }
+
+ public MasterFD getMasterFD() {
+ return new MasterFD();
+ }
+
+ /**
+ * @return whether this pseudo terminal is for use with the Eclipse console.
+ */
+ public final boolean isConsole() {
+ return console;
+ }
+
+ public OutputStream getOutputStream() {
+ return out;
+ }
+
+ public InputStream getInputStream() {
+ return in;
+ }
+
+ /**
+ * Change terminal window size to given width and height.
+ * <p>
+ * This should only be used when the pseudo terminal is configured for use with a terminal emulation, i.e. when
+ * {@link #isConsole()} returns {@code false}.
+ * </p>
+ * <p>
+ * <strong>Note:</strong> This method may not be supported on all platforms. Known platforms which support this method
+ * are: {@code linux-x86}, {@code linux-x86_64}, {@code solaris-sparc}, {@code macosx}.
+ * </p>
+ * @param width the given width.
+ * @param height the given height.
+ */
+ public final void setTerminalSize(int width, int height) {
+
+ }
+
+ public static boolean isSupported() {
+ return true;
+ }
+
+ public void setOutputStream(OutputStream outputStream) {
+ out = outputStream;
+ }
+
+ public void setInputStream(InputStream inputStream) {
+ in = inputStream;
+ }
+
+ public void setErrorStream(InputStream errorStream) {
+ // TODO Auto-generated method stub
+ }
+}
diff --git utils/org/eclipse/cdt/utils/pty/Terminal.java utils/org/eclipse/cdt/utils/pty/Terminal.java
index a51a8e1..4d44b9d 100644
--- utils/org/eclipse/cdt/utils/pty/Terminal.java
+++ utils/org/eclipse/cdt/utils/pty/Terminal.java
@@ -7,141 +7,21 @@
*******************************************************************************/
package org.eclipse.cdt.utils.pty;
-import java.io.IOException;
-
-import com.google.eclipse.elt.pty.PtyPlugin;
+import java.io.InputStream;
+import java.io.OutputStream;
/**
* PTY - pseudo terminal support.
*/
-public class PTY {
- static final String LIBRARY_NAME = "gpty";
+public interface Terminal {
- final boolean console;
- String slave;
- PTYInputStream in;
- PTYOutputStream out;
- /*
- * NOTE: Field is accessed by the native layer. Do not refactor!
- */
- int master;
+ public String getSlaveName();
- private static boolean hasPTY;
- private static boolean setTerminalSizeErrorAlreadyLogged;
+ public boolean isConsole();
- /**
- * The master fd is used on two streams. We need to wrap the fd so that when stream.close() is called the other stream
- * is disabled.
- */
- public class MasterFD {
- public int getFD() {
- return master;
- }
+ public OutputStream getOutputStream();
- void setFD(int fd) {
- master = fd;
- }
- }
+ public InputStream getInputStream();
- /**
- * Create PTY for use with Eclipse console. Identical to {@link PTY#PTY(boolean) PTY(true)}.
- * @throws IOException if something goes wrong.
- */
- public PTY() throws IOException {
- this(true);
- }
-
- /**
- * Create pseudo-terminal.
- *
- * <p>
- * The provided flag indicates whether the pseudo terminal is used with the interactive Eclipse console:
- * <ul>
- * <li>If {@code true} the terminal is configured with no echo and stderr is redirected to a pipe instead of the
- * PTY.</li>
- * <li>If {@code false} the terminal is configured with echo and stderr is connected to the PTY. This mode is
- * best suited for use with a proper terminal emulation. Note that this mode might not be supported on all platforms.
- * Known platforms which support this mode are: <code>linux-x86</code>, <code>linux-x86_64</code>,
- * <code>solaris-sparc</code>, <code>macosx</code>.</li>
- * </ul>
- * </p>
- *
- * @param console whether terminal is used with Eclipse console
- * @throws IOException if the PTY could not be created
- * @since 5.2
- */
- public PTY(boolean console) throws IOException {
- this.console = console;
-
- if (hasPTY) {
- slave = openMaster(console);
- }
-
- if (slave == null) {
- throw new IOException(PtyPlugin.getResourceString("Util.exception.cannotCreatePty"));
- }
-
- in = new PTYInputStream(new MasterFD());
- out = new PTYOutputStream(new MasterFD());
- }
-
- public String getSlaveName() {
- return slave;
- }
-
- public MasterFD getMasterFD() {
- return new MasterFD();
- }
-
- /**
- * @return whether this pseudo terminal is for use with the Eclipse console.
- */
- public final boolean isConsole() {
- return console;
- }
-
- public PTYOutputStream getOutputStream() {
- return out;
- }
-
- public PTYInputStream getInputStream() {
- return in;
- }
-
- /**
- * Change terminal window size to given width and height.
- * <p>
- * This should only be used when the pseudo terminal is configured for use with a terminal emulation, i.e. when
- * {@link #isConsole()} returns {@code false}.
- * </p>
- * <p>
- * <strong>Note:</strong> This method may not be supported on all platforms. Known platforms which support this method
- * are: {@code linux-x86}, {@code linux-x86_64}, {@code solaris-sparc}, {@code macosx}.
- * </p>
- * @param width the given width.
- * @param height the given height.
- */
- public final void setTerminalSize(int width, int height) {
- try {
- change_window_size(master, width, height);
- } catch (UnsatisfiedLinkError e) {
- if (!setTerminalSizeErrorAlreadyLogged) {
- setTerminalSizeErrorAlreadyLogged = true;
- PtyPlugin.log(PtyPlugin.getResourceString("Util.exception.cannotSetTerminalSize"), e);
- }
- }
- }
-
- public static boolean isSupported() {
- return hasPTY;
- }
-
- native String openMaster(boolean console);
-
- native int change_window_size(int fdm, int width, int height);
-
- static {
- System.loadLibrary(LIBRARY_NAME);
- hasPTY = true;
- }
+ public void setTerminalSize(int width, int height);
}
diff --git utils/org/eclipse/cdt/utils/pty/TerminalFactory.java utils/org/eclipse/cdt/utils/pty/TerminalFactory.java
new file mode 100644
index 0000000..7912910
--- /dev/null
+++ utils/org/eclipse/cdt/utils/pty/TerminalFactory.java
@@ -0,0 +1,28 @@
+package org.eclipse.cdt.utils.pty;
+
+import java.io.IOException;
+
+public class TerminalFactory {
+
+ static private TerminalFactory instance;
+
+ private boolean ptySupported;
+
+ private TerminalFactory() {
+ }
+
+ public static TerminalFactory getFactory() {
+ if (instance == null) {
+ instance = new TerminalFactory();
+ }
+ return instance;
+ }
+
+ public Terminal createTerminal(boolean console) throws IOException {
+ if (PTY.isSupported()) {
+ return new PTY(console);
+ } else {
+ return new SoftTerminal(console);
+ }
+ }
+}
diff --git utils/org/eclipse/cdt/utils/spawner/ProcessFactory.java utils/org/eclipse/cdt/utils/spawner/ProcessFactory.java
index d01c706..2cb127a 100644
--- utils/org/eclipse/cdt/utils/spawner/ProcessFactory.java
+++ utils/org/eclipse/cdt/utils/spawner/ProcessFactory.java
@@ -7,9 +7,11 @@
*******************************************************************************/
package org.eclipse.cdt.utils.spawner;
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
-import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.cdt.utils.pty.SoftTerminal;
+import org.eclipse.cdt.utils.pty.Terminal;
import com.google.eclipse.elt.pty.PtyPlugin;
@@ -28,7 +30,7 @@
hasSpawner = false;
} else {
System.loadLibrary(Spawner.LIBRARY_NAME);
- hasSpawner = true;
+ hasSpawner = false; // TODO jacek.p should be true
}
}
@@ -81,9 +83,16 @@
return runtime.exec(cmdarray, envp, dir);
}
- public Process exec(String cmdarray[], String[] envp, File dir, PTY pty) throws IOException {
+ public Process exec(String cmdarray[], String[] envp, File dir, Terminal pty) throws IOException {
if (hasSpawner) {
return new Spawner(cmdarray, envp, dir, pty);
+ } else if (pty instanceof SoftTerminal) {
+ SoftTerminal st = (SoftTerminal) pty;
+ Process process = runtime.exec(cmdarray, envp, dir);
+ st.setOutputStream(process.getOutputStream());
+ st.setInputStream(process.getInputStream());
+ st.setErrorStream(process.getErrorStream());
+ return process;
}
throw new UnsupportedOperationException(PtyPlugin.getResourceString("Util.exception.cannotCreatePty"));
}
diff --git utils/org/eclipse/cdt/utils/spawner/Spawner.java utils/org/eclipse/cdt/utils/spawner/Spawner.java
index e778b70..1c06577 100644
--- utils/org/eclipse/cdt/utils/spawner/Spawner.java
+++ utils/org/eclipse/cdt/utils/spawner/Spawner.java
@@ -7,10 +7,14 @@
*******************************************************************************/
package org.eclipse.cdt.utils.spawner;
-import java.io.*;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
import java.util.StringTokenizer;
import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.cdt.utils.pty.Terminal;
import org.eclipse.core.runtime.Platform;
import org.eclipse.osgi.util.NLS;
@@ -59,7 +63,7 @@
OutputStream out;
InputStream in;
InputStream err;
- private PTY fPty;
+ private Terminal fPty;
public Spawner(String command, boolean bNoRedirect) throws IOException {
StringTokenizer tokenizer = new StringTokenizer(command);
@@ -82,7 +86,7 @@
exec(command, environment, dirpath);
}
- protected Spawner(String[] cmdarray, String[] envp, File dir, PTY pty) throws IOException {
+ protected Spawner(String[] cmdarray, String[] envp, File dir, Terminal pty) throws IOException {
String dirpath = ".";
if (dir != null) {
dirpath = dir.getAbsolutePath();
@@ -301,7 +305,7 @@
}
}
- private void exec_pty(String[] command, String[] environment, String workingDirectory, PTY pty) throws IOException {
+ private void exec_pty(String[] command, String[] environment, String workingDirectory, Terminal pty) throws IOException {
String cmd = command[0];
SecurityManager s = System.getSecurityManager();
if (s != null) {
@@ -311,7 +315,7 @@
environment = new String[0];
}
final String slaveName = pty.getSlaveName();
- final int masterFD = pty.getMasterFD().getFD();
+ final int masterFD = ((PTY)pty).getMasterFD().getFD();
final boolean console = pty.isConsole();
// int fdm = pty.get
Reaper reaper = new Reaper(command, environment, workingDirectory) {
#P com.google.eclipse.elt.view
diff --git bin/com/google/eclipse/elt/view/Activator.class bin/com/google/eclipse/elt/view/Activator.class
new file mode 100644
index 0000000..6bbc2fe
--- /dev/null
+++ bin/com/google/eclipse/elt/view/Activator.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/ImageKeys.class bin/com/google/eclipse/elt/view/ImageKeys.class
new file mode 100644
index 0000000..c41b388
--- /dev/null
+++ bin/com/google/eclipse/elt/view/ImageKeys.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/command/OpenTerminalCommand.class bin/com/google/eclipse/elt/view/command/OpenTerminalCommand.class
new file mode 100644
index 0000000..9a8ac68
--- /dev/null
+++ bin/com/google/eclipse/elt/view/command/OpenTerminalCommand.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/connector/LifeCycleListener.class bin/com/google/eclipse/elt/view/connector/LifeCycleListener.class
new file mode 100644
index 0000000..7c4c43f
--- /dev/null
+++ bin/com/google/eclipse/elt/view/connector/LifeCycleListener.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/connector/LocalTerminalConnector$1.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/connector/LocalTerminalConnector$1.class
new file mode 100644
index 0000000..85958c1
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/connector/LocalTerminalConnector$1.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/connector/LocalTerminalConnector.class bin/com/google/eclipse/elt/view/connector/LocalTerminalConnector.class
new file mode 100644
index 0000000..5fdac45
--- /dev/null
+++ bin/com/google/eclipse/elt/view/connector/LocalTerminalConnector.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/connector/Messages.class bin/com/google/eclipse/elt/view/connector/Messages.class
new file mode 100644
index 0000000..b6ed357
--- /dev/null
+++ bin/com/google/eclipse/elt/view/connector/Messages.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/connector/Messages.properties bin/com/google/eclipse/elt/view/connector/Messages.properties
new file mode 100644
index 0000000..e9586a6
--- /dev/null
+++ bin/com/google/eclipse/elt/view/connector/Messages.properties
@@ -0,0 +1,2 @@
+localTerminalName=Terminal
+errorNoPseudoTerminalSupport=Pseudo-terminal support is not available on your host ({0}.{1})
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/connector/PseudoTerminal$1.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/connector/PseudoTerminal$1.class
new file mode 100644
index 0000000..419220b
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/connector/PseudoTerminal$1.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/connector/PseudoTerminal.class bin/com/google/eclipse/elt/view/connector/PseudoTerminal.class
new file mode 100644
index 0000000..55978e2
--- /dev/null
+++ bin/com/google/eclipse/elt/view/connector/PseudoTerminal.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/connector/TerminalOutputListener.class bin/com/google/eclipse/elt/view/connector/TerminalOutputListener.class
new file mode 100644
index 0000000..73066e4
--- /dev/null
+++ bin/com/google/eclipse/elt/view/connector/TerminalOutputListener.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/connector/TerminalOutputStream.class bin/com/google/eclipse/elt/view/connector/TerminalOutputStream.class
new file mode 100644
index 0000000..6eae341
--- /dev/null
+++ bin/com/google/eclipse/elt/view/connector/TerminalOutputStream.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/preferences/AbstractPreferencesChangeListener.class bin/com/google/eclipse/elt/view/preferences/AbstractPreferencesChangeListener.class
new file mode 100644
index 0000000..8c58a62
--- /dev/null
+++ bin/com/google/eclipse/elt/view/preferences/AbstractPreferencesChangeListener.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/preferences/ColorSettingPreviewText.txt bin/com/google/eclipse/elt/view/preferences/ColorSettingPreviewText.txt
new file mode 100644
index 0000000..b434966
--- /dev/null
+++ bin/com/google/eclipse/elt/view/preferences/ColorSettingPreviewText.txt
@@ -0,0 +1,8 @@
+$ mkdir ~/Hello-World
+$ cd ~/Hello-World
+$ git init
+$ touch README
+$ git add README
+$ git commit -m 'first commit'
+$ git remote add origin https://code.google.com/p/elt/
+$ git push -u origin master
\ No newline at end of file
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$1.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$1.class
new file mode 100644
index 0000000..b1fdad6
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$1.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$2.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$2.class
new file mode 100644
index 0000000..3c88877
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$2.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$3.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$3.class
new file mode 100644
index 0000000..31d616e
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$3.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$4.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$4.class
new file mode 100644
index 0000000..d84359c
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$4.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$5.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$5.class
new file mode 100644
index 0000000..769fb8a
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$5.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$6.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$6.class
new file mode 100644
index 0000000..1e085b5
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$6.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$ColorChangeListener.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$ColorChangeListener.class
new file mode 100644
index 0000000..bf77f92
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage$ColorChangeListener.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage.class bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage.class
new file mode 100644
index 0000000..397c3eb
--- /dev/null
+++ bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferencePage.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferences.class bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferences.class
new file mode 100644
index 0000000..def2017
--- /dev/null
+++ bin/com/google/eclipse/elt/view/preferences/ColorsAndFontsPreferences.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/preferences/GeneralPreferences.class bin/com/google/eclipse/elt/view/preferences/GeneralPreferences.class
new file mode 100644
index 0000000..bbfa56a
--- /dev/null
+++ bin/com/google/eclipse/elt/view/preferences/GeneralPreferences.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/preferences/Messages.class bin/com/google/eclipse/elt/view/preferences/Messages.class
new file mode 100644
index 0000000..809f7a8
--- /dev/null
+++ bin/com/google/eclipse/elt/view/preferences/Messages.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/preferences/Messages.properties bin/com/google/eclipse/elt/view/preferences/Messages.properties
new file mode 100644
index 0000000..55d4de9
--- /dev/null
+++ bin/com/google/eclipse/elt/view/preferences/Messages.properties
@@ -0,0 +1,17 @@
+backgroundAndForegroundCannotBeTheSame=Background and foreground colors cannot be the same
+backgroundPrompt=Background:
+bufferLineCount=Terminal buffer lines:
+change=Change...
+closeViewOnExit=Close view when terminal exits
+colorsAndFontsTitle=Terminal colors and fonts preferences.
+foregroundPrompt=Foreground:
+generalPreferencesTitle=General preferences.
+invalidBufferLineCount=Value should be an integer between {0} and {1}
+previewPrompt=Preview:
+textFontLink=Eclipse's "Text Font" can be configured on the <a href=\"org.eclipse.ui.preferencePages.ColorsAndFonts\">'Colors and Fonts'</a> preference page.
+unableToLoadPreviewContent=Unable to load preview content
+useBlinkingCursor=Use blinking cursor
+useCustomFont=Use custom font
+useTextFont=Use Eclipse's "Text Font"
+warnOnClose=Warn on close
+
diff --git bin/com/google/eclipse/elt/view/preferences/PreferenceInitializer.class bin/com/google/eclipse/elt/view/preferences/PreferenceInitializer.class
new file mode 100644
index 0000000..d05b61a
--- /dev/null
+++ bin/com/google/eclipse/elt/view/preferences/PreferenceInitializer.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/preferences/PreferenceNames.class bin/com/google/eclipse/elt/view/preferences/PreferenceNames.class
new file mode 100644
index 0000000..7b12661
--- /dev/null
+++ bin/com/google/eclipse/elt/view/preferences/PreferenceNames.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/RootPreferencePage$1.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/RootPreferencePage$1.class
new file mode 100644
index 0000000..9280fdd
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/preferences/RootPreferencePage$1.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/preferences/RootPreferencePage.class bin/com/google/eclipse/elt/view/preferences/RootPreferencePage.class
new file mode 100644
index 0000000..4f322dc
--- /dev/null
+++ bin/com/google/eclipse/elt/view/preferences/RootPreferencePage.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/ui/Messages.class bin/com/google/eclipse/elt/view/ui/Messages.class
new file mode 100644
index 0000000..683827b
--- /dev/null
+++ bin/com/google/eclipse/elt/view/ui/Messages.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/ui/Messages.properties bin/com/google/eclipse/elt/view/ui/Messages.properties
new file mode 100644
index 0000000..a2ebc48
--- /dev/null
+++ bin/com/google/eclipse/elt/view/ui/Messages.properties
@@ -0,0 +1,9 @@
+alwaysCloseWithoutWarn=Always close without warn
+changeTerminalTitle=Change Title
+closeTerminalQuestion=Close terminal?
+confirmCloseDialogTitle=Confirm Close
+defaultViewTitle=Terminal
+enterTerminalTitleDialogTitle=Terminal Title
+enterTerminalTitlePrompt=Enter the new title for the terminal:
+newLocalTerminal=New Terminal
+scrollLock=Scroll Lock
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/PopupMenu$1.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/PopupMenu$1.class
new file mode 100644
index 0000000..0763d5b
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/PopupMenu$1.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/PopupMenu$2.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/PopupMenu$2.class
new file mode 100644
index 0000000..0de408e
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/PopupMenu$2.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/PopupMenu$PopupMenuManager.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/PopupMenu$PopupMenuManager.class
new file mode 100644
index 0000000..b9361a0
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/PopupMenu$PopupMenuManager.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/ui/PopupMenu.class bin/com/google/eclipse/elt/view/ui/PopupMenu.class
new file mode 100644
index 0000000..38c7272
--- /dev/null
+++ bin/com/google/eclipse/elt/view/ui/PopupMenu.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$1.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$1.class
new file mode 100644
index 0000000..c94d8d5
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$1.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$2.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$2.class
new file mode 100644
index 0000000..e3a73ed
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$2.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$3.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$3.class
new file mode 100644
index 0000000..245f90d
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$3.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$4.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$4.class
new file mode 100644
index 0000000..ef3e8b4
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$4.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$5.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$5.class
new file mode 100644
index 0000000..fed7f0f
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$5.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$6.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$6.class
new file mode 100644
index 0000000..e060cd0
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$6.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$ChangeViewNameAction$1.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$ChangeViewNameAction$1.class
new file mode 100644
index 0000000..d140425
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$ChangeViewNameAction$1.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$ChangeViewNameAction.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$ChangeViewNameAction.class
new file mode 100644
index 0000000..37663f2
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$ChangeViewNameAction.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$NewTerminalAction.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$NewTerminalAction.class
new file mode 100644
index 0000000..89fe79c
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$NewTerminalAction.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$ScrollLockAction.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$ScrollLockAction.class
new file mode 100644
index 0000000..654e121
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalView$ScrollLockAction.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/ui/TerminalView.class bin/com/google/eclipse/elt/view/ui/TerminalView.class
new file mode 100644
index 0000000..5fa4557
--- /dev/null
+++ bin/com/google/eclipse/elt/view/ui/TerminalView.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalWidget$1.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalWidget$1.class
new file mode 100644
index 0000000..d467c00
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalWidget$1.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalWidget$2.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalWidget$2.class
new file mode 100644
index 0000000..89d8977
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalWidget$2.class
Binary files differ
diff --git a/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalWidget$TerminalListener.class b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalWidget$TerminalListener.class
new file mode 100644
index 0000000..57f53a5
--- /dev/null
+++ b/com.google.eclipse.elt.view/bin/com/google/eclipse/elt/view/ui/TerminalWidget$TerminalListener.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/ui/TerminalWidget.class bin/com/google/eclipse/elt/view/ui/TerminalWidget.class
new file mode 100644
index 0000000..55c1c27
--- /dev/null
+++ bin/com/google/eclipse/elt/view/ui/TerminalWidget.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/ui/WarnOnCloseDialog.class bin/com/google/eclipse/elt/view/ui/WarnOnCloseDialog.class
new file mode 100644
index 0000000..7751ace
--- /dev/null
+++ bin/com/google/eclipse/elt/view/ui/WarnOnCloseDialog.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/util/Encodings.class bin/com/google/eclipse/elt/view/util/Encodings.class
new file mode 100644
index 0000000..37ccc52
--- /dev/null
+++ bin/com/google/eclipse/elt/view/util/Encodings.class
Binary files differ
diff --git bin/com/google/eclipse/elt/view/util/Platform.class bin/com/google/eclipse/elt/view/util/Platform.class
new file mode 100644
index 0000000..4518318
--- /dev/null
+++ bin/com/google/eclipse/elt/view/util/Platform.class
Binary files differ
diff --git src/com/google/eclipse/elt/view/connector/PseudoTerminal.java src/com/google/eclipse/elt/view/connector/PseudoTerminal.java
index 6082aff..aadf2ec 100644
--- src/com/google/eclipse/elt/view/connector/PseudoTerminal.java
+++ src/com/google/eclipse/elt/view/connector/PseudoTerminal.java
@@ -8,16 +8,19 @@
*/
package com.google.eclipse.elt.view.connector;
+import static com.google.eclipse.elt.view.util.Platform.defaultShell;
+import static com.google.eclipse.elt.view.util.Platform.environment;
import static java.lang.Thread.currentThread;
import static java.util.concurrent.Executors.newSingleThreadExecutor;
-import static com.google.eclipse.elt.view.util.Platform.*;
-
-import java.io.*;
-import java.util.*;
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
import java.util.concurrent.ExecutorService;
-import org.eclipse.cdt.utils.pty.PTY;
+import org.eclipse.cdt.utils.pty.Terminal;
+import org.eclipse.cdt.utils.pty.TerminalFactory;
import org.eclipse.cdt.utils.spawner.ProcessFactory;
/**
@@ -30,7 +33,7 @@
private final File workingDirectory;
private Process process;
- private PTY pty;
+ private Terminal pty;
private int width;
private int height;
@@ -40,9 +43,10 @@
}
void launch() throws IOException {
- ProcessFactory factory = ProcessFactory.getFactory();
- pty = new PTY(false);
- process = factory.exec(command(), environment(), workingDirectory, pty);
+ ProcessFactory factory = ProcessFactory.getFactory();
+ TerminalFactory tfactory = TerminalFactory.getFactory();
+ pty = tfactory.createTerminal(false);
+ process = factory.exec(command(), environment(), workingDirectory, pty);
executor.execute(new Runnable() {
@Override public void run() {
try {
@@ -83,7 +87,7 @@
}
static boolean isPlatformSupported() {
- return PTY.isSupported();
+ return true;
}
void disconnect() {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment