Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Minimal changes to allow STS 'long running process' to execute commands ... #269

Merged
merged 1 commit into from Sep 24, 2012
Jump to file or symbol
Failed to load files and symbols.
+14 −5
Split
@@ -241,16 +241,19 @@ private boolean isWindows() {
public static synchronized GrailsConsole getInstance() {
if (instance == null) {
try {
- instance = createInstance();
+ setInstance(createInstance());
} catch (IOException e) {
throw new RuntimeException("Cannot create grails console: " + e.getMessage(), e);
}
}
-
+ return instance;
+ }
+
+ public static void setInstance(GrailsConsole newConsole) {
+ instance = newConsole;
if (!(System.out instanceof GrailsConsolePrintStream)) {
System.setOut(new GrailsConsolePrintStream(instance.out));
}
- return instance;
}
public static GrailsConsole createInstance() throws IOException {
@@ -45,8 +45,14 @@
private Boolean eclipseSupportsAnsi = null; //lazy initialized because implicitly used from super constructor.
- protected GrailsEclipseConsole() throws IOException {
- super();
+ /**
+ * Create a GrailsConsole that has some customizations to work better with STS. Note that
+ * this console implicitly captures and redirects System.out, System.err and System.in in the
+ * super class. So extreme care must be taken to ensure these streams are setup correctly
+ * before creating an instance.
+ */
+ public GrailsEclipseConsole() throws IOException {
+ super();
}
@Override