  }
  
 -#if !defined(UNIX) || !defined(SIGTSTP) || defined(PROTO) || defined(__BEOS__)
-+#if !defined(UNIX) || !defined(SIGTSTP) || defined(PROTO) || defined(__BEOS__) || defined(__HAIKU__) 
++#if !defined(UNIX) || !defined(SIGTSTP) || defined(PROTO) || defined(__BEOS__) || defined(__HAIKU__)
  /*
   * When the OS can't really suspend, call this function to start a shell.
   * This is never called in the GUI.
-@@ -1739,7 +1739,7 @@
-      * If we can't get any, and there isn't any in the buffer, we give up and
-      * exit Vim.
-      */
--# ifdef __BEOS__
-+# if defined(__BEOS__) || defined(__HAIKU__)
-     /*
-      * On the BeBox version (for now), all input is secretly performed within
-      * beos_select() which is called from RealWaitForChar().
 diff -Naur vim72/src/version.c vim72.haiku/src/version.c
 --- vim72/src/version.c	2009-04-19 20:53:35.000000000 +0000
 +++ vim72.haiku/src/version.c	2009-04-23 22:39:10.000000000 +0000

diff -Naur vim72/src/os_unix.c vim72.haiku/src/os_unix.c
--- vim72/src/os_unix.c	2009-04-19 20:53:35.000000000 +0000
+++ vim72.haiku/src/os_unix.c	2009-04-26 20:57:12.000000000 +0000
@@ -51,7 +51,7 @@
  */
 #ifndef __TANDEM
 # undef select
-# ifdef __BEOS__
+# if defined(__BEOS__) || defined(__HAIKU__)
 #  define select	beos_select
 # endif
 #endif
@@ -155,7 +155,7 @@
 static void may_core_dump __ARGS((void));
 
 static int  WaitForChar __ARGS((long));
-#if defined(__BEOS__)
+#if defined(__BEOS__) || defined(__HAIKU__)
 int  RealWaitForChar __ARGS((int, long, int *));
 #else
 static int  RealWaitForChar __ARGS((int, long, int *));
@@ -1094,7 +1094,7 @@
 mch_suspend()
 {

+		gui.vimWindow->Unlock();
+}
+
+#define RUN_BAPPLICATION_IN_NEW_THREAD	0
+
+#if RUN_BAPPLICATION_IN_NEW_THREAD
+
