c9 / core

Cloud9 Core - Part of the Cloud9 SDK for Plugin Development https://c9.github.io/core/ https://c9.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Challenges facing the terminal control character usage on iPad via bluetooth keyboard

HouzuoGuo opened this issue · comments

Good day.

I got an iPad (2018 model) together with a quite generic bluetooth keyboard (sandstrom). Apple is perhaps making it a little challenging for web page to receive control character input via Control+[a-z] key combination. Take a look at this:

"showkey -a" was running in the terminal and I pressed all combinations of Control+[a-z], apparently very few were heard by the terminal, and among them the most useful combinations (C-c, C-d, C-z) aren't heard:
img_0583

In this second attempt I browsed a generic key event tester, it further proves that Apple is making it challenging for web page to work with these control characters (be aware of the reversed table record order):
img_0584

Upgrading the iPad to iOS 12 preview doesn't offer any improvement in this regard, unfortunately. Cloud9 won't open in several other major browsers such as Chrome and Firefox, claiming that third-party cookies aren't available over there, hence I couldn't test their performance with cloud9.

Thinking aloud, on iOS the Alt+[a-z] combinations are used to type infrequently used characters. Would you consider introducing an IDE preference option to interpret those characters as control characters, as a workaround to this challenge?

Many thanks.

As a proof-of-concept, here is the idea implemented under a newer version of tmux (e.g. 2.6) that supports re-interception of key stroke via rebinding key:

bind-key -Troot å send-keys C-a
bind-key -Troot ∫ send-keys C-b
bind-key -Troot ç send-keys C-c
bind-key -Troot ∂ send-keys C-d
# E: c9 uses it to display "looks good!"
bind-key -Troot ƒ send-keys C-f
bind-key -Troot © send-keys C-g
bind-key -Troot ˙ send-keys C-h
# I: appears to modify the next key, no predictable code.
bind-key -Troot ∆ send-keys C-j
# K: c9 does not see it at all
# L: c9 uses it to open a new terminal
bind-key -Troot µ send-keys C-m
# N: c9 uses it to open a new editor
bind-key -Troot ø send-keys C-o
bind-key -Troot π send-keys C-p
bind-key -Troot œ send-keys C-q
# R: c9 does not see it at all
# S: c9 does not see it at all
# T: c9 uses it to open a new terminal
bind-key -Troot ¨ send-keys C-u
bind-key -Troot √ send-keys C-v
# W: c9 uses it to close current tab
bind-key -Troot ≈ send-keys C-x
bind-key -Troot ¥ send-keys C-y
bind-key -Troot Ω send-keys C-z

And here is the result, works quite incredibly well, I am quite glad to get a fully functional terminal out of this setup!

img_0585