Added Support for terminal from filemanager

 * Now We can open terminal from current directory in filemanager

Signed-off-by: Mohd Faraz <androiabledroid@gmail.com>
Change-Id: I6df9ee1222c1fa24105da1002abe3c180be2ded1
Signed-off-by: AndroiableDroid <mohd.faraz.abc@gmail.com>
diff --git a/gui/terminal.cpp b/gui/terminal.cpp
index a4fed91..79262eb 100755
--- a/gui/terminal.cpp
+++ b/gui/terminal.cpp
@@ -46,7 +46,6 @@
 #endif
 
 extern int g_pty_fd; // in gui.cpp where the select is
-
 /*
 Pseudoterminal handler.
 */
@@ -142,7 +141,7 @@
 			return -1;
 		}
 		int rc = ::write(fdMaster, buffer, size);
-		debug_printf("pty write: %d bytes -> %d\n", size, rc);
+		debug_printf("pty write: %zu bytes -> %d\n", size, rc);
 		if (rc < 0) {
 			LOGERR("pty write failed: %d\n", errno);
 			// assume child has died
@@ -386,6 +385,14 @@
 				output(buffer[i]);
 	}
 
+	bool status() {
+		return pty.started();
+	}
+
+	void stop() {
+		pty.stop();
+	}
+
 	void clear()
 	{
 		cursorX = cursorY = 0;
@@ -899,6 +906,17 @@
 	// do nothing - terminal ignores selections
 }
 
+bool GUITerminal::status()
+{
+	return engine->status();
+}
+
+void GUITerminal::stop()
+{
+	engine->stop();
+	engine->clear();
+}
+
 void GUITerminal::InitAndResize()
 {
 	// make sure the shell is started