diff --git a/src/apps/terminal/Shell.cpp b/src/apps/terminal/Shell.cpp index 48a3c42b0b..5f3f30678e 100644 --- a/src/apps/terminal/Shell.cpp +++ b/src/apps/terminal/Shell.cpp @@ -31,7 +31,6 @@ #include #include -#define MAXPTTYS 16 * 4 #ifndef CEOF #define CEOF ('D'&037) @@ -55,29 +54,6 @@ #define CSWTCH 0 #endif -/* - * ANSI emulation. - */ -#define INQ 0x05 -#define FF 0x0C /* C0, C1 control names */ -#define LS1 0x0E -#define LS0 0x0F -#define CAN 0x18 -#define SUB 0x1A -#define ESC 0x1B -#define US 0x1F -#define DEL 0x7F -#define HTS ('H'+0x40) -#define SS2 0x8E -#define SS3 0x8F -#define DCS 0x90 -#define OLDID 0x9A /* ESC Z */ -#define CSI 0x9B -#define ST 0x9C -#define OSC 0x9D -#define PM 0x9E -#define APC 0x9F -#define RDEL 0xFF /* default shell command and options. */ const char *kDefaultShellCommand = { "/bin/sh" "-login" }; @@ -460,7 +436,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg /* * set terminal interface. */ - if (tcsetattr (0, TCSANOW, &tio) == -1) { + if (tcsetattr(0, TCSANOW, &tio) == -1) { handshake.status = PTY_NG; snprintf(handshake.msg, sizeof(handshake.msg), "failed set terminal interface (TERMIOS)."); @@ -506,7 +482,6 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg setenv("TTYPE", encoding, true); setenv("SHELL", *argv, true); - execve(*argv, (char * const *)argv, environ); /* diff --git a/src/apps/terminal/TermParse.cpp b/src/apps/terminal/TermParse.cpp index 8a34eaeabd..8de49fbb5c 100644 --- a/src/apps/terminal/TermParse.cpp +++ b/src/apps/terminal/TermParse.cpp @@ -102,9 +102,6 @@ TermParse::StopThreads() fQuitting = true; - //suspend_thread(fReaderThread); - // TODO: interrupt read() - doesn't work for whatever reason - StopPtyReader(); StopTermParse(); @@ -229,7 +226,11 @@ TermParse::StopPtyReader() if (fReaderThread >= 0) { status_t dummy; - wait_for_thread(fReaderThread, &dummy); + //suspend_thread(fReaderThread); + // TODO: interrupt read() - doesn't work for whatever reason + //wait_for_thread(fReaderThread, &dummy); + kill_thread(fReaderThread); + fReaderThread = -1; } } diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp index 61c9df358e..94019b0f3d 100644 --- a/src/apps/terminal/TermView.cpp +++ b/src/apps/terminal/TermView.cpp @@ -328,10 +328,13 @@ TermView::_InitObject(int32 argc, const char **argv) TermView::~TermView() { + Shell *shell = fShell; + // _DetachShell sets fShell to NULL + printf("TermView::~TermView()\n"); _DetachShell(); delete fTextBuffer; - delete fShell; + delete shell; fQuitting = true; kill_thread(fMouseThread);