Some of the key inputs on my nvim running in xterm are a bit odd. For example, to get the '^' key, I have to press shift-6, and instead of it just generating a '^' character, it actually generates '<S-^>'. The rest of the symbols on the number keys (ie, !, ", £, $, ....) just generate what one would expect; ie, '!', '"', '£', '$' etc. I have the same issue with a few other symbol keys that are not on the number row.
I've not had this issue before, using terminals other than xterm, so to get around this, I have had to modify some of my vim function mappings accordingly. Annoying but it seems to work.
However, I have a function that calls getcharstr() and this is causing some problems. In the case of the '^' character, getcharstr() actually returns the sequence '<80><fc>^B^' (where '^B' is, I think, ctrl-B, and the trailing ^ is the literal '^' character). I know that getcharstr() returns 128 for the first byte of an 'encoded' character. This explains the <80>. But I'm at a loss regarding the <fc>^B bit
My question is, how do I test this string against '<S-^>' (or preferably, just '^')? Clearly, as it stands, it doesn't match and I'm unsure of a general way I can/should pre-process the input string before comparing it. Another sequence that causes me problems is <M->>. This presents itself to nvim (running in xterm) as <M-S->>, and getcharstr() returns the sequence '<80><fc>*>' (where '*' is a 'newline' character - ASCII 10 - eh??)
Alternatively, and this would make life much easier, is there any way of setting xterm or vim/nvim to generate more sensible characters - ie, just '^' instead of '<S-^>'? (I'm still interested in how to tackle this from within vim though, even if xterm can be 'fixed')
<S-^>being generated instead of just^(though not necessarily the '^' character), so it's not just me. And if I could work out how to fix xterm, I would"\<S-^>"actually expands out to'<80><fc>^B^'. All these years using vim and I never knew that! Oh well. Still no idea why xterm is generating<S-^>instead of just^thoughmodifyOtherKeysand some of the characters will differ with other terminals because they don't follow xkb as closely.