Greg Wooledge <g...@wooledge.org> wrote: > On Mon, Mar 27, 2023 at 08:45:18PM +0100, debian-u...@howorth.org.uk > wrote: > > Greg Wooledge <g...@wooledge.org> wrote: > > > Just to be clear, are you using some kind of Desktop Environment > > > specific means of entering these Unicode characters? I don't know > > > what CTRL-SHIFT-Uunicode means. If I try it here, it just gets > > > interpreted as Ctrl-U which kills the line I'm typing in vim. > > > > No, he's using a standard keyboard mechanism which works well inside > > gvim here for example, or in a normal terminal (lxterminal to be > > precise). You hold down CTRL and SHIFT and then press U. You should > > see an underlined lower case letter U. Now type the four digit > > code, e.g. 2660. You will see the digits be echoed, also underlined > > and perhaps with a coloured background. Now press ENTER and the > > whole lot is magically replaced with a 'black spade suit' glyph. > > I tried this in rxvt(-unicode), xterm, and lxterm (which is apparently > part of the xterm package -- never heard of it before!).
It's lxterminal, not lxterm, and it's part of LXDE so I'm surprised if it's bundled with xterm. > In all 3 terminals, Ctrl-Shift-U simply acts like Ctrl-U. If there's > already text typed at the bash prompt, it's all erased. If there's no > text typed at the bash prompt, it beeps. It seems to be a somewhat complex thing. It might be invoked by ibus, apparently, but I don't have that installed. I don't know what all the possibilities are for enabling or disabling the facility. You can see it described at https://en.wikipedia.org/wiki/Table_of_keyboard_shortcuts under the heading of Insert Unicode for linux. There's no qualification there, unfortunately. > Interstingly, though, in rxvt-unicode, if I only press Ctrl-Shift and > skip the U, a small region of the terminal window (lower left corner, > which is annoyingly right where the cursor is) is colored yellow and > says "ISO 14755 mode". If I keep holding Ctrl-Shift and type 2660 > then the yellow region gets bigger and shows lots of text, including > a spade character. When I release the Ctrl and Shift keys, the > yellow goes away, and I'm left with just a spade character typed into > the shell. > > This is a feature I was not previously aware of. It also doesn't work > in xterm or lxterm. > > You spoke of gvim, which I don't have installed, but which I'm fairly > sure is a GUI program. So, I tried a GUI program -- Google Chrome. I > opened a new tab and went to google.com which I know has a text entry > widget. In the text entry widget, I tried this Ctrl-Shift-U thing, > and there, it works as you claimed it should. Space and Enter both > seem to terminate the Unicode entry. "x" does not. It works here in both vim (the terminal-based editor) and gvim (the identically-functioned separate window-based version). Hitting space instead of enter causes it to erase everything back to and including the CTRL-SHIFT-U. > It also works in Firefox. > > So it looks like this "standard keyboard mechanism" is part of some > GUI toolkit, either X11, or GTK+, or something along those lines. > It definitely doesn't work in a regular X terminal, nor would I expect > it to. The mechanism is specified by the standard ISO 41755, but it doesn't specify the introducer sequence. I have no idea how it is enabled or disabled.