Edit: This port is no longer developed. I suggest you'd rather use kterm, especially if your Kindle runs firmware version greater or equal to 5.3 or if you need a solution for Paperwhite.
Inspired by Kindle Developer Corner on MobileRead forum I built kindle version of xterm and virtual matchbox-keyboard. I used crosstool-ng. It works on Kindle Touch with firmwares 5.1–5.2. I can't test it on other devices.
Xterm version is 279 downloaded from xterm webpage. Matchbox-keyboard source package version 0.1+svn20080916 I downloaded from debian repository. I compiled it statically against libfakekey-0.1. I got keyboard layout from this page, which I modified. This is a layout based on images instead of text. I couldn't make matchbox-keyboard work with text buttons, as it was raising glibc exception (while calling XftDrawStringUtf8 and XftTextExtentsUtf8). The layout still needs some adjustments, but basic functionality is available right now.
Using Xresources I mapped keys to popup menus and some functions:
I used Terminus fonts. Users are encouraged to customize fonts and add their own shortcuts editing file Xresources in xterm/layouts folder.
Additionally main menu may be accessed by touching the upper right corner of the screen. This may be helpful in case something goes wrong with the virtual keyboard and you have to restart the keyboard or quit application without it.
To change screen orientation use "Rotate screen" option in the main menu
To use accented characters, like Ã or Ü, you need to turn on "UTF-8 Encoding" option from Fonts menu.
I prepared package to be used with YiFanLu's Launcher. First install the Launcher, then download zip package from this page and unzip its contents to extensions folder on your kindle. Restart kindle, so that new item is visible in the Launcher menu. Start it from the menu. To exit just type exit in the xterm or choose "quit" from popup menu.
Installation of XTerm package doesn't change any system files on your Kindle. All the files are installed only in extensions folder. To uninstall just delete xterm folder from extensions.