patch 7.4.1395
Problem:    Using DETACH in quotes is not compatible with the Netbeans
            interface. (Xavier de Gaye)
Solution:   Remove the quotes, only use them for JSON and JS mode.
diff --git a/src/channel.c b/src/channel.c
index f189ac0..71fd4b6 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -1554,7 +1554,8 @@
 
 
 /* Sent when the channel is found closed when reading. */
-#define DETACH_MSG "\"DETACH\"\n"
+#define DETACH_MSG_RAW "DETACH\n"
+#define DETACH_MSG_JSON "\"DETACH\"\n"
 
 /* Buffer size for reading incoming messages. */
 #define MAXMSGSIZE 4096
@@ -1658,6 +1659,7 @@
     int			readlen = 0;
     sock_T		fd;
     int			use_socket = FALSE;
+    char		*msg;
 
     fd = channel->ch_part[part].ch_fd;
     if (fd == INVALID_FD)
@@ -1721,8 +1723,10 @@
 	 *			-> channel_read()
 	 */
 	ch_errors(channel, "%s(): Cannot read", func);
-	channel_save(channel, part,
-			       (char_u *)DETACH_MSG, (int)STRLEN(DETACH_MSG));
+	msg = channel->ch_part[part].ch_mode == MODE_RAW
+				  || channel->ch_part[part].ch_mode == MODE_NL
+		    ? DETACH_MSG_RAW : DETACH_MSG_JSON;
+	channel_save(channel, part, (char_u *)msg, (int)STRLEN(msg));
 
 	/* TODO: When reading from stdout is not possible, should we try to
 	 * keep stdin and stderr open?  Probably not, assume the other side