Re: Xterm and function keys
Hi again! Sorry to bother you again with this, but unfortunately noone replied. Must have chosen a bad time for my posting. :-) I discovered a strange thing: In an xterm the function keys produce the following: F1 -> ^[OP F2 -> ^[OQ F3 -> ^[OR F4 -> ^[OS F5 -> ^[[15~ F6 -> ^[[16~ ... On a different system (I tried SuSE) they produce: F1 -> ^[[11~ F2 -> ^[[12~ F3 -> ^[[13~ F4 -> ^[[14~ F5 -> ^[[15~ F6 -> ^[[16~ ... which seems more correct. I also get this behaviour on my Debian (potato) box when I use rxvt or konsole. I don't think I misconfigured anything, because I confirmed this behavior with a newly added user, too. Do you have any idea where the problem is? Thanks a lot, Andy. -- E-Mail: [EMAIL PROTECTED] URL: http://andy.spiegl.de PGP/GPG: see headers o _ _ _ - __o __o /\_ _ \\o (_)\__/o (_) --- _`\<,__`\<,__>(_) (_)/<_\_| \ _|/' \/ -- (_)/ (_) (_)/ (_) (_)(_) (_)(_)' _\o_ ~~~ New Win98 error message: "Runtime Error 6D at 417A:32CF: Incompetent User."
Re: Xterm and function keys
Andy Spiegl <[EMAIL PROTECTED]> writes: >In an xterm the function keys produce the following: > F1 -> ^[OP > F2 -> ^[OQ > F3 -> ^[OR > F4 -> ^[OS > F5 -> ^[[15~ > F6 -> ^[[16~ >... > >On a different system (I tried SuSE) they produce: > F1 -> ^[[11~ > F2 -> ^[[12~ > F3 -> ^[[13~ > F4 -> ^[[14~ > F5 -> ^[[15~ > F6 -> ^[[16~ >... >which seems more correct. I also get this behaviour on my Debian (potato) >box when I use rxvt or konsole. On my system, the xterm bindings are ^[OP, ^[OQ, ^[OR, ^[OS, ^[[15~, ^[[17~, ^[[18~, ... (^[[16~ is missing for some reason.) rxvt creates ^[11~ and so forth. On the linux console, they are ^[[[A, ^[[[B, ^[[[C, ^[[[D, ^[[[E, ^[[17~, ^[[18~, etc. But the ^[OP etc. are "normal" for xterms. There is really nothing that says that something is "correct" and something else is not; as long as the keys agree with what your terminal type specifies, everything should work. Different terminals are just, well, different. The differences seem quite arbitrary, but they probably have historical reasons behind them... All of the xterm, xterm-debian and xterm-xfree86 terminal types are specified so that F1=^[OP. (You can see this by executing "infocmp xterm-debian" and looking for "kf1=\EOP" in the output (^[ = \E = the ESC character). The terminal type is selected with the TERM environment variable, which xterm and the other programs should automatically set to a correct value.) So, basically, please don't care about it. :) If some keys don't work somewhere, check your TERM environment variable and/or complain (but please look at /usr/doc/xterm/README.Debian first, though the problems it talks about concern mostly the Backspace and Delete keys). If you write your own programs, don't depend on particular key bindings; get them from terminfo instead. Otherwise, don't worry about it... -- -=- Rjs -=- [EMAIL PROTECTED]
Re: Xterm and function keys
Riku Saikkonen wrote: > Andy Spiegl <[EMAIL PROTECTED]> writes: > >In an xterm the function keys produce the following: > > F1 -> ^[OP > > F2 -> ^[OQ > > F3 -> ^[OR > > F4 -> ^[OS > > F5 -> ^[[15~ > > F6 -> ^[[16~ Oops, that was a type. Correct is: > > F6 -> ^[[17~ > But the ^[OP etc. are "normal" for xterms. Hm, okay I start to understand... > All of the xterm, xterm-debian and xterm-xfree86 terminal types are > specified so that F1=^[OP. (You can see this by executing "infocmp > xterm-debian" and looking for "kf1=\EOP" in the output (^[ = \E = the > ESC character). Interesting! > So, basically, please don't care about it. :) I really would like to, but I can't. Besides the fact that my coworkers who are running SuSE-Linux are always trying to find weaknesses of Debian (and vice versa :-), I am running into problems when remote administring non-Debian machines: I have to set the TERM-type to from xterm-debian to xterm, but then curses based tools (like SuSE's YaST for example) don't recognize the function keys. > please look at /usr/doc/xterm/README.Debian first, though the problems > it talks about concern mostly the Backspace and Delete keys). I know the this README, but as you say, it only talks about Backspace and Delete. I just tried the terminfo approach and that seems to work! So I guess I solved my problem, but I still don't really like it. However I now understand that it's not a Debian problem, but a general X problem. Things should be standardized better. :-( Thanks for your help, Andy. -- E-Mail: [EMAIL PROTECTED] URL: http://andy.spiegl.de PGP/GPG: see headers o _ _ _ - __o __o /\_ _ \\o (_)\__/o (_) --- _`\<,__`\<,__>(_) (_)/<_\_| \ _|/' \/ -- (_)/ (_) (_)/ (_) (_)(_) (_)(_)' _\o_ ~~~ A feature is a bug with seniority.
Re: Xterm and function keys
Andy Spiegl <[EMAIL PROTECTED]> writes: [about xterm function key bindings, ^[OP vs. ^[[11~] >I just tried the terminfo approach and that seems to work! So I guess I >solved my problem, but I still don't really like it. However I now >understand that it's not a Debian problem, but a general X problem. Things >should be standardized better. :-( Yep... This terminfo approach (the "workaround 2" described in /usr/doc/xterm/README.Debian) should fix everything that uses terminfo (which is almost all applications where it matters, including all curses applications; some old systems might still use termcap for something). But it needs to be set up on every account that you use. If you also use the text-mode console for connecting to non-Linux systems, you might want to do the same workaround for /etc/terminfo/l/linux. For what it's worth, I've seen these problems also between different commercial Unix systems (SGI, HP, DEC, etc.), sometimes also between different programs on one system. (And between Windows and Unix, but I don't use Windows, so I can't say more about that.) At least Debian has a workaround for some problems in its documentation. :) -- -=- Rjs -=- [EMAIL PROTECTED]