# Tab completion of \\uXXXX in the REPL?

**URL:** <https://discourse.julialang.org/t/tab-completion-of-uxxxx-in-the-repl/108442>\
**Category:** Internals & Design\
**Tags:** unicode\
**Created:** [January 6, 2024, 3:23pm UTC](https://discourse.julialang.org/t/tab-completion-of-uxxxx-in-the-repl/108442 "2024-01-06T15:23:08Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [January 7, 2024, 9:31am UTC](https://discourse.julialang.org/t/tab-completion-of-uxxxx-in-the-repl/108442/21 "2024-01-07T09:31:53Z")

</div>

Whenever I need to find a Unicode glyph, I use Glyphy.jl:

 ![Screenshot 2024-01-07 at 09.22.08](https://global.discourse-cdn.com/julialang/original/3X/d/b/db8d25d26e43c54cfc10a7313b1feb2edf71c71d.png)

and then I can copy/paste from here.

Of course, the glyphs can only be displayed if you have the fonts/fallback fonts around that include them. So you probably won’t see any glyphs for the Zanabazarin Dörböljin Useg script, for example:

```plaintext
julia-1.10> glyphy("zanabazar")

11a00 𑨀 zanabazar square letter a
11a01 𑨁 zanabazar square vowel sign i
11a02 𑨂 zanabazar square vowel sign ue
11a03 𑨃 zanabazar square vowel sign u
...

```

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [January 7, 2024, 2:28pm UTC](https://discourse.julialang.org/t/tab-completion-of-uxxxx-in-the-repl/108442/22 "2024-01-07T14:28:36Z")

</div>

I would also like a concrete example where this makes sense. One of the best aspects of LaTeX completions is that it’s now supported in a fairly consistent way across many editong environments, from the Julia REPL to Jupyter notebooks to VS Code, Emacs, vim, SublimeText and so on. If the Julia REPL added a massive set of new completions (all code points), then it would be out of balance with all the other environments. Of course, it’s hard to picture when you’d use it, so perhaps it doesn’t matter, but then again if that’s the case then why add the feature in the first place?

---

<div class="post-metadata">

**Author:** ![devel-chm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/devel-chm/32/3572_2.png) [@devel-chm](https://discourse.julialang.org/u/devel-chm)\
**Post date:** [January 7, 2024, 7:58pm UTC](https://discourse.julialang.org/t/tab-completion-of-uxxxx-in-the-repl/108442/23 "2024-01-07T19:58:07Z")

</div>

@foobar_lv2 This topic was split off from your recent [discourse thread](https://discourse.julialang.org/t/syntax-escape-hatch-for-unicode-haters/108363) but it started as a suggestion addressing some of the issues in your posts in that discussion.

> [@Syntax: Escape hatch for unicode haters](https://discourse.julialang.org/t/syntax-escape-hatch-for-unicode-haters/108363/1):
>
> my input keyboard should not constrain the set of ASTs I can generate.

My proposal is adding better, more uniform support for Unicode entry by extending  
the REPL tab completion from the current _ad hoc_ LaTeX-ish expansions by allowing  
expansion of any Unicode codepoint in the REPL.

I see this as more a polishing of the existing REPL expansion capability to allow entry  
of any Unicode character and not just the set of characters that are blessed by historic  
or common usage, such as \alpha or \mu. This would not only allow any Unicode  
character to be entered, but could also enable search/recognition of existing aliases.  
If there were no existing alias, it could offer an immediate ability to add an entry to  
complete that character.

While there was a generally dismissive attitude towards this capability, the  
discussions clarified what is available in the existing Julia support that could be  
leveraged to smooth some of the rough edges:

1. String macros could be implemented (here are examples for Unicode only support  
and for LaTeX only support). N.B. My proposal would essentially combine these 2  
into the existing REPL TAB completion capability.

2. Entering the glyph as a character will display the unicode codepoint value

3. You can use string escape sequences to return a string with the desired unicode in it

For additional information on Unicode support currently in Julia, see the documentation for  
the [Unicode standard library](https://docs.julialang.org/en/v1/stdlib/Unicode/).

I hope this collected information is helpful for anyone having some of these Unicode pain points.  
My thanks to everyone who participated in this discussion.

Also, I meant to include [use Glyphy](https://discourse.julialang.org/t/tab-completion-of-uxxxx-in-the-repl/108442/21) in the suggestion by @cormullion, thanks!

---

<div class="post-metadata">

**Author:** ![foobar\_lv2](https://avatars.discourse-cdn.com/v4/letter/f/ee59a6/32.png) [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Post date:** [January 12, 2024, 10:39am UTC](https://discourse.julialang.org/t/tab-completion-of-uxxxx-in-the-repl/108442/24 "2024-01-12T10:39:47Z")

</div>

> [@devel-chm](#):
>
> My proposal is adding better, more uniform support for Unicode entry by extending  
> the REPL tab completion from the current _ad hoc_ LaTeX-ish expansions by allowing  
> expansion of any Unicode codepoint in the REPL.

For what its worth, this would not address (let even ameliorate) my issue.

My issue is that many editing contexts I use in everyday life are not julia aware, and therefore cannot support julia-specific tab-completions.

I think the latex-style ad-hoc tab-completions from the REPL and most julia-aware editors are pretty nice! But this does not solve the issue that e.g. web-browser text input fields (like here on discourse), various git mergetools, and editing contexts on less-than-ideally configured machines make input of “foreign” chars so hard.

Technically, it should be the job of my OS to make keyboard input of foreign characters convenient, and it should be the job of these tools to use syscalls / libraries that allow my OS to help me make this convenient. Practically speaking, mankind failed at OS design in this regard (possible: Yes, accessibility tools for variously disabled people are a thing. Convenient: Nope!).

Julia acknowledges this failure by the very existence of REPL tab completions, but somehow fails to acknowledge that you sometimes want to edit code from outside REPL / IDE.

…and then there is the even harder collection of settings, like less / `@less` (text input field: search via `/`), shell contexts (eg xterm + bash) for use of things like `git commit -m` or `grep`. `sed` is also still a thing, but I have not yet run into julia-specific pain-points with that. This is even harder because the spelling of unicode characters is not normalized: e.g. different codepoints for e.g. `\mu<TAB>` that the parser turns into the same `Symbol` (but the `Symbol` constructor doesn’t!).

[Previous page](https://discourse.julialang.org/t/tab-completion-of-uxxxx-in-the-repl/108442.md?page=1)
