exports = module.exports = function (UI) {

  var setHistoryHeight = function () {
    // Set the history component dynamic height
    UI.components.history.height = UI.screen.height - UI.components.input.height;
  };

  UI.screen.on('prerender', function () {
    setHistoryHeight();
  });

  UI.screen.on('resize', function () {
    setHistoryHeight();
    UI.screen.render();
  });

  // If box is focused, handle `Control+s`.
  UI.components.input.key('C-s', function(ch, key) {
    var message = this.getValue();
    UI.context.room.writeMessage(message);

    this.clearValue();
    UI.screen.render();
  });

  // Quit on `q`, or `Control-C` when the focus is on the screen
  UI.screen.key(['q', 'C-c'], function (ch, key) {
    return process.exit(0);
  });

  // Focus on `escape` or `i` when focus is on the screen.
  UI.screen.key(['escape', 'i'], function () {
    // Set the focus on the input.
    UI.components.input.focus();
  });

  UI.screen.key(['up', 'down'], function (ch, key) {
    UI.components.history[key.name]();
  });
};

@@ -933,32 +933,63 @@
 focus();%0A  %7D);%0A%0A
+  // History scrolling events.%0A
   UI.screen.key(
@@ -1000,12 +1000,9 @@
 ', '
-down
+k
 '%5D, 
@@ -1003,39 +1003,115 @@
 'k'%5D, function (
-ch, key
+) %7B%0A    UI.components.history.up();%0A  %7D);%0A  UI.screen.key(%5B'down', 'j'%5D, function (
 ) %7B%0A    UI.compo
@@ -1127,18 +1127,13 @@
 tory
-%5Bkey.name%5D
+.down
 ();%0A
@@ -1138,11 +1138,12 @@
 ;%0A  %7D);%0A
+%0A
 %7D;%0A

Add vi scrolling keys to scrolling key-binding