Index: uspace/srv/hid/remcons/remcons.c
===================================================================
--- uspace/srv/hid/remcons/remcons.c	(revision 6f7cd5da3b0f1d7617a2393b3a3f247d14403b57)
+++ uspace/srv/hid/remcons/remcons.c	(revision 3806317addecfc44d41ef2b0a3f5739b6e683022)
@@ -54,4 +54,5 @@
 #include <io/console.h>
 #include <inttypes.h>
+#include "telnet.h"
 
 
@@ -83,4 +84,18 @@
 static FIBRIL_MUTEX_INITIALIZE(clients_guard);
 static LIST_INITIALIZE(clients);
+
+/** Telnet commands to force character mode
+ * (redundant to be on the safe side).
+ * See
+ * http://stackoverflow.com/questions/273261/force-telnet-client-into-character-mode
+ * for discussion.
+ */
+static const telnet_cmd_t telnet_force_character_mode_command[] = {
+	TELNET_IAC, TELNET_WILL, TELNET_ECHO,
+	TELNET_IAC, TELNET_WILL, TELNET_SUPPRESS_GO_AHEAD,
+	TELNET_IAC, TELNET_WONT, TELNET_LINEMODE
+};
+static const size_t telnet_force_character_mode_command_count =
+    sizeof(telnet_force_character_mode_command) / sizeof(telnet_cmd_t);
 
 static client_t *client_create(int socket)
@@ -308,11 +323,7 @@
 	fibril_mutex_unlock(&client->refcount_mutex);
 
-	/*
-	 * Force character mode.
-	 * IAC WILL ECHO IAC WILL SUPPRESS_GO_AHEAD IAC WONT LINEMODE
-	 * http://stackoverflow.com/questions/273261/force-telnet-client-into-character-mode
-	 */
-	const char force_char_mode[] = {255, 251, 1, 255, 251, 3, 255, 252, 34};
-	send(client->socket, (void *)force_char_mode, sizeof(force_char_mode), 0);
+	/* Force character mode. */
+	send(client->socket, (void *)telnet_force_character_mode_command,
+	    telnet_force_character_mode_command_count, 0);
 
 	client_connection_message_loop(client);
Index: uspace/srv/hid/remcons/telnet.h
===================================================================
--- uspace/srv/hid/remcons/telnet.h	(revision 3806317addecfc44d41ef2b0a3f5739b6e683022)
+++ uspace/srv/hid/remcons/telnet.h	(revision 3806317addecfc44d41ef2b0a3f5739b6e683022)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2012 Vojtech Horky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup remcons
+ * @{
+ */
+/** @file
+ */
+
+#ifndef TELNET_H_
+#define TELNET_H_
+
+#include <inttypes.h>
+
+typedef uint8_t telnet_cmd_t;
+
+/*
+ * Telnet commands.
+ */
+
+#define TELNET_IAC 255
+#define TELNET_WILL 251
+#define TELNET_WONT 252
+#define TELNET_ECHO 1
+#define TELNET_SUPPRESS_GO_AHEAD 3
+#define TELNET_LINEMODE 34
+
+
+#endif
+
+/**
+ * @}
+ */
