9

I am thinking about retiring my portable for an iPad + keyboard. (With Amazon/Linode/etc as server.)

I tried the iSSH app and ran Emacs in a terminal (not X Windows), using the Apple external keyboard.

This is unusable. Some extra chars are generated with control-F and option for Meta (Escape) generates some extra characters. There are probably other problems.

Terminal programs can't just remove/add/modify stuff as they like! Especially not for Emacs!

This problem was discussed already at the iPad launch.

The specifics for iSSH was discussed at least last November. (A fix was promised for the next release, which was in March.) http://groups.google.com/group/issh/browse_thread/thread/b58508bb42a3241e?pli=1

I saw in other discussions a few months ago that the "Prompt" app should work better, but that it had other problems? It was updated a few weeks ago.

Any advice on how to make this work? Prompt?


Edit, a conclusion: I have checked Prompt now. It doesn't have programmable keys and no way to get the Alt X to send real ESC X. I'll see what chars are generated by the keyboard and if I can put that into Emacs.

So iSSH has programmable keys (and lots of other features) except for control keys, but no working Control. And Prompt has working Control keys but no possibility to set up keys. The union of them would be perfect. :-(

At least both applications are under active development, so this should show up.

2
  • Just one tip that I found helpful: in many environments, an equivalent to Esc is Ctrl-[.
    – Kai Carver
    Commented Jul 26, 2012 at 0:36
  • 1
    I was using Ctrl-[ to send Esc on my new logitech tablet keyboard until I realized there is a much more natural way -- fn-☐ (you know, that box-symbol key where the escape key should have been). Careful, if you don't hold "fn" down then it will just exit the ssh app. Commented Oct 22, 2012 at 22:31

2 Answers 2

3

Prompt is generally considered to be the best (or at least among the best) SSH clients for iOS. I've never used it specifically for emacs (as I don't use emacs) but I've never seen it send strange extra characters, even when sending control characters to, say, nano.

Edit: Prompt version 1.3.2 now has a feature where you can use the Escape key as a Meta key.

6
  • @BerntBudde nano doesn't use Option/Meta, so I don't know.
    – Cajunluke
    Commented Apr 9, 2012 at 13:51
  • I tried Prompt and it doesn't seem to have any logic for using the Option key as Meta in emacs. Also, you only had three font sizes and hence irregular shell/Emacs window sizes. Why does BOTH ssh Apps go 95% of the way, with complex functionality, but stop before making it usable? :-( Commented Apr 10, 2012 at 14:32
  • 1
    @BerntBudde Panic's support is really good. If you ask them about your issue, they may be able to give you a workaround or they may be able to fix whatever bugs prevent it from working properly.
    – Cajunluke
    Commented Apr 10, 2012 at 14:41
  • THanks, CajunLuke. If I had voting rights I'd vote you up. :-) I put my conclusions in the question above. When this feature get into the ssh clients, I'll update it. Commented Apr 11, 2012 at 17:00
  • @BerntBudde There's been an update to Prompt to (quote from the release notes) "Click and hold on the Esc key to access a Meta key".
    – Cajunluke
    Commented Aug 7, 2012 at 15:50
1

I have also started using Emacs via SSH from my iPad with an external Bluetooth keyboard. I'm using Prompt and I've come up with the following code to "re-enable" the Option key as Meta. most of the keys work except for B, E, I, N, U and `. Put this in your .emacs file. Note that I use the Dvorak layout and I haven't tested this with a QWERTY layout.

(define-key key-translation-map [?\C-h] [?\C-?]) ; Unmask 'delete' as backspace

(let ((translations '( 229 [?\M-a]  nil [?\M-b]   231 [?\M-c]  8706 [?\M-d]   nil [?\M-e]
                       402 [?\M-f]  169 [?\M-g]   729 [?\M-h]   nil [?\M-i]  8710 [?\M-j]
                       730 [?\M-k]  172 [?\M-l]   181 [?\M-m]   nil [?\M-n]   248 [?\M-o]
                       960 [?\M-p]  339 [?\M-q]   174 [?\M-r]   223 [?\M-s]  8224 [?\M-t]
                       nil [?\M-u] 8730 [?\M-v]  8721 [?\M-w]  8776 [?\M-x]   165 [?\M-y]
                       937 [?\M-z]
                        96 [?\M-~]  161 [?\M-1]   162 [?\M-4]   163 [?\M-3]   167 [?\M-6]
                       170 [?\M-9]  171 [?\M-\\]  175 [?\M-<]   176 [?\M-*]   177 [?\M-+]
                       182 [?\M-7]  183 [?\M-\(]  186 [?\M-0]   187 [?\M-|]   191 [?\M-\?]
                       198 [?\M-\"] 230 [?\M-']   247 [?\M-/]   728 [?\M->]  8211 [?\M-\-]
                      8212 [?\M-_] 8216 [?\M-\]] 8217 [?\M-}]  8218 [?\M-\)] 8220 [?\M-\[] 
                      8221 [?\M-{] 8225 [?\M-&]  8226 [\?M-8]  8249 [?\M-#]  8250 [?\M-$] 
                      8260 [?\M-!] 8364 [\?M-@]  8482 [?\M-2]  8734 [\?M-5]  8800 [?\M-=]
                      8804 [?\M-,] 8805 [?\M-.] 64257 [?\M-%] 64258 [?\M-^])))
  (while translations
    (let ((key (car translations)) (def (cadr translations)))
      (if key
          (define-key key-translation-map (make-string 1 key) def)))
    (setq translations (cddr translations))))

This gets Prompt much closer to the Right Thing. It still needs to handle the missing keys (which trigger 'chords' that input multi-character sequences) or disable "non-ASCII" input altogether, and a "use Caps Lock as Control" setting would be very nice also. I'll email their customer support and see what they say.

2
  • Nice work synchromesh! Thanks for sharing this, works for me on qwerty on blink shell. Well, at least Alt-x (I can map Alt to M if desired) does and that is what I was after, I haven't tested the others. Question: how did you get the key codes (the first element in each pair)?
    – Joe
    Commented Apr 15, 2021 at 1:26
  • TBH @Joe I don't recall - it was nine years ago. :) Commented Apr 22, 2021 at 2:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .