From c5c4534c9d7292826da2c6c839261c54b35ac7da Mon Sep 17 00:00:00 2001
From: Or Cohen <orc@fewbytes.com>
Date: Tue, 10 Sep 2013 17:26:44 +0300
Subject: [PATCH] Added basic readline configuration

Parsed by JLine (in CRaSH)
Console should now better understand keys like home/end/arrows
---
 bootfs.manifest    |  1 +
 static/etc/inputrc | 43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+)
 create mode 100644 static/etc/inputrc

diff --git a/bootfs.manifest b/bootfs.manifest
index ebf196260..978869353 100644
--- a/bootfs.manifest
+++ b/bootfs.manifest
@@ -96,3 +96,4 @@
 /console/dhclient.js: ../../console/dhclient.js
 /&/console/perf.js: ../../&
 /&/etc/hosts: ../../static/&
+/&/etc/inputrc: ../../static/&
diff --git a/static/etc/inputrc b/static/etc/inputrc
new file mode 100644
index 000000000..c0ba0f0ac
--- /dev/null
+++ b/static/etc/inputrc
@@ -0,0 +1,43 @@
+# /etc/inputrc - inputrc for JLine
+
+# some defaults / modifications for the emacs mode
+$if mode=emacs
+
+# allow the use of the Home/End keys
+"\e[1~": beginning-of-line
+"\e[4~": end-of-line
+
+# allow the use of the Delete/Insert keys
+"\e[3~": delete-char
+"\e[2~": quoted-insert
+
+# mappings for "page up" and "page down" to step to the beginning/end
+# of the history
+# "\e[5~": beginning-of-history
+# "\e[6~": end-of-history
+
+# alternate mappings for "page up" and "page down" to search the history
+# "\e[5~": history-search-backward
+# "\e[6~": history-search-forward
+
+# mappings for Ctrl-left-arrow and Ctrl-right-arrow for word moving
+"\e[1;5C": forward-word
+"\e[1;5D": backward-word
+"\e[5C": forward-word
+"\e[5D": backward-word
+"\e\e[C": forward-word
+"\e\e[D": backward-word
+
+"\e[8~": end-of-line
+"\eOc": forward-word
+"\eOd": backward-word
+
+# for non RH/Debian xterm, can't hurt for RH/Debian xterm
+"\eOH": beginning-of-line
+"\eOF": end-of-line
+
+# for freebsd console
+"\e[H": beginning-of-line
+"\e[F": end-of-line
+
+$endif
-- 
GitLab