How can I press escape on a Bluetooth keyboard with my iPhone? I sometimes use a BlueTooth keyboard with my iPhone, which is lovely for writing emails, but I run into difficulties when using terminal on the iPhone - I like to edit files with vi(m), which requires quite a lot of presses of the escape key, but every time I press escape, the iPhone interprets that as a request to go back to the home screen and sends me out of the app.

Any ideas?
Terminal hasn't been updated for nearly a year now, so unfortunately there are some imperfections as things change in iOS. 
But for this case, though, I believe the escape key is actually controlled by SpringBoard, not any apps, which means Terminal can't capture and send the escape key to the command-line program. 

The iPhone Wiki article on Terminal has information on keyboard shortcuts, and it says that the key shortcut for escape is Ctrl + [ (• + [ on the virtual keyboard).

However, if my assumptions above are correct, the only way to use the real escape key would be to write a tweak to redirect the escape command to Terminal.