I want to somehow generate a comprehensive "menu" of all possible ways to set up the GNU-screen "command characters" for a standard, off-the-shelf "US keyboard" and a specific terminal emulator, say xfce4-terminal.
I imagine that this universe of possibilities would decompose into three lists:
- list A: all the possible values of the
- list B: all the possible values for the
<CODE>parameter in the expression
bindkey -k <CODE> command, together with the "null setting" (i.e. the
.screenrcconfig in which no
bindkey -k <CODE> commanddirective is used)
- list C: a mapping from any pair (a, b) (where a ∈ A, and b ∈ B) to an explicit description of how one would type the corresponding GNU-screen command character on a standard US keyboard, and assuming a specific terminal emulator (IOW, something equivalent to, for instance, "simultaneously press Ctrl and \").
Keep in mind, however, that these specs are a "best effort" by someone (me) who really does not understand the underlying basics. I hope that those who do understand these basics will be able to "read between the lines", and modify these specs as needed, while still retaining the spirit of the question (see Background), to render the question tractable.
I realize that the "menu" I'm hoping for may be very large, but I figure that it can't be intractably so, since, after all, the number of keys on a standard US keyboard is finite and not ginormous, and the set of fingers one can use for this purpose is even more so. (In case it matters, I could further stipulate that I am only interested in key combinations consisting of at most, say, 2 sequential "key chords", with at most 3 keys per key chord. By "key chord" I mean "set of keys to be pressed simultaneously".)
This question is actually a follow-up to a comment by Gilles in a thread I started earlier. It turns out that most of what that comment says is beyond my grasp. I figure that there are some huge gaps in my understanding of the basics here, so big in fact that I cannot even articulate sufficiently clear questions to fill them.
In a nutshell, it is a huge mystery to me that, for example, the key combination Ctrl + \ can be used to type the "command character" for GNU-screen, whereas other similar-looking key combinations, like (maybe) Ctrl + ', cannot 1.
Without a clear understanding of the underlying basics from the user (like me), the search for a suitable GNU-screen command character reduces to a sequence of isolated proposals ("How about Ctrl + H? After all, no one uses that for anything else.") that the user evaluates in turn until an acceptable one pops up.
How long this sequence of proposals and evaluations needs to go on depends on the size of the set of acceptable key combinations for that user. Clearly, this size will vary from one user to the next. In my case, it appears to be smaller than average, and as a result this approach has not yet given me an acceptable "command character" for GNU-screen.
The approach, in any case, seems to me inherently inefficient. It make more sense to me to be able to choose the best option from an explicit "universe" (i.e. "exhaustive set") of possibilities. This is what I'm trying to get at here.
EDIT: OK, after some studying, I now have a clear picture of how one types the (1-byte) characters in the ASCII range between
\0177, inclusive. These include all the "true" "control characters".
Also, I figure that list A can be described as all possible pairs of integers between
\0377, although probably many of these pairs can be ruled out as completely impractical. (E.g., those in which the first element of the pair is common "printable character", such as "e" or "8").
I'm still trying to figure out the following:
how to type the (1-byte) characters in the ASCII range
\0377, inclusive; I expect there will be some variation across terminals and terminal emulators on this, but I have no sense at the moment of how chaotic the variation is; is there a subset of these characters on which there is a substantial consensus? If so, I would love to know what these characters are (and how to type them)
how to get useful values for list B; I realize that these values are
termcapcodes; my difficulty here is not having a way to identify those
termcapcodes that map neatly to a convenient key combination; e.g. I know that the code
F2maps to F12 (sic), but I imagine that most
termcapcodes don't have such a neat association with a single key.
how to complete list C, even for a specific terminal emulator, and the "null setting" from list B.
1Please, don't attempt to explain this mystery to me: many very knowledgeable, and very patient, people have tried, and I still don't get it. The "knowledge gap" between those who understand what's going on and me is so great that their answers are invariably as baffling to me as what they aim to address. What I'm hoping to achieve with this post is precisely to work around this huge knowledge gap, by casting the question as a search for, in essence, an algorithm (to construct a prescribed finite set of possibilities) that could be implemented by even someone who does not understand the underlying basics.