support for ESC % G
michal.svoboda at agents.felk.cvut.cz
Mon Apr 19 10:01:30 CEST 2010
Marc Lehmann wrote:
> The solution for your problem is to use the correct TERM setting,
This is somewhat dubious attitude since as I said urxvt already contains
some compatibility features that go beyond what is strictly necessary
for TERM=rxvt-unicode. How is this feature different?
> Bullshit - the kernel doesn't have any access to your locale info, so
> it simply is incapable of this, it can only be done in userspace.
> > Try echoing ESC % @ and catting an utf8 file, then the same with ESC
> > % G.
> Well, try it yourself, obviously the locale of cat or other programs
> will be the same as before (including what they might or might not
> think about e.g. character width).
Yes. I don't know how the term 'locale' got incorporated here. The
sequence is about switching encodings. With % @ it will treat incoming
bytes as in latin1, with % G as in utf8. Obviously you should use % G if
you want to run a program that uses the utf8 locale on the console fd,
otherwise you'll get 2 or more gibberish chars for each non-ascii one.
I believe urxvt derives its input encoding from the current locale
setting, so it already should support either encoding at launch time.
Making the encoding run-time switchable via the esc sequence shouldn't
be too hard.
> > Plus Linux VT eats the whole sequence. Urxvt eats half of it.
> Yes, and if you sent it control codes specific to hp terminals, it
> will also not support it.
How many users have requested compatibility with hp terminals recently?
> It's printed only on deliberately misconfigured systems, i.e. yours.
I don't see how my terminal is misconfigured. In fact it is pretty well
configured to match the behavior of the 'linux' term. There are tons of
terminal programs that don't have that much configuration options. I'm
using (u)rxvt for what? 10+ years specifically because of this.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 198 bytes
Desc: not available
More information about the rxvt-unicode