How to type arbitrary unicode characters in xterm

unicodexterm

Moving away from using gnome-terminal and terminator since they are excruciatingly slow. (20-30 seconds to change focus to them for whatever reason)

xterm is nice and fast. However, I need to be able to type certain unicode characters in vim for documents I am working on. With gnome-terminal and terminator I could do ctrl+shift+u + hex code, however that does not work in xterm.

How do I type arbitrary unicode characters in xterm?

OS is Debian 8.

Thanks!

Best Answer

xterm doesn't implement a hexadecimal-input feature because all of the text editors which handle UTF-8 provide their own equivalents (emacs, vim and vile, of course, even nano). This could be useful in a shell script, but is not often mentioned. The feature was first implemented in Windows, of course.

To enter multibyte (e.g., UTF-8) characters in xterm, you would use compose sequences. As a special case, the meta key can be used as a sort of shift to get the 128-255 coverage of UTF-8, but aside from that, compose is what works.

gnome-terminal (more properly VTE), also implements compose, although there are some differences.

Further reading: