mawww / kakoune

mawww's experiment for a better code editor
http://kakoune.org
The Unlicense
9.9k stars 713 forks source link

barely any emoji work in kakoune on macos from nixpkgs #4257

Open BrianHicks opened 3 years ago

BrianHicks commented 3 years ago

Hey! Like https://github.com/mawww/kakoune/issues/3059, my kak has trouble displaying emoji. Unlike that poster, I see hardly any emoji at all for an emoji prompt definition:

image

:help keymap also has some issues with missing characters:

image

I've installed Kakoune through nixpkgs on macOS. Here's what otool thinks of this binary:

$ otool -L  /nix/store/s0f6vv25wsn59wkjkfzgw5xjr2q47ljq-kakoune-unwrapped-2020.09.01/bin/kak
/nix/store/s0f6vv25wsn59wkjkfzgw5xjr2q47ljq-kakoune-unwrapped-2020.09.01/bin/kak:
        /nix/store/34j3wczgnxy0p1p8vliawppqfxd7gfp3-ncurses-6.2/lib/libncursesw.6.dylib (compatibility version 6.0.0, current version 6.0.0)
        /nix/store/nrsa1l0kh3vxindfkfa1d5fw62yvac4d-libc++-7.1.0/lib/libc++.1.0.dylib (compatibility version 1.0.0, current version 1.0.0)
        /nix/store/h144jawqa92rqjhaahrsikq5j2dwkh5n-Libsystem-osx-10.12.6/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1226.10.1)

The same configuration works on NixOS, however! So it does seem to be some system thing. Any ideas? I can try and recompile kakoune with a different set of dependencies through Nix, but I'm not sure which ones would make sense!

BrianHicks commented 3 years ago

I just tried this with homebrew's kak and got the same result!

eraserhd commented 3 years ago

Interesting. I'm using Kakoune on Mac OS from nixpkgs -- except I'm using the builtin-terminal-ui branch, and I was surprised to find that I have the same issue (exact same characters not rendering) with :help keymap. On the other hand, it does much better with emoji_prompt ():

emoji_prompt

I'm using kitty, what terminal emulator are you using?

BrianHicks commented 3 years ago

I'm using kitty, what terminal emulator are you using?

This happens for me in both iTerm2 and Terminal.app, and both inside and outside of tmux. I will maybe try recompiling with the builtin-terminal-ui branch!

eraserhd commented 3 years ago

I don't remember whether this could be a font issue, also. Worth a shot. I'm using "Input Mono Narrow".

Screwtapello commented 3 years ago

I'm pretty sure this is a duplicate of #3059 - Kakoune relies on the system-provided Unicode database to determine which Unicode characters are valid, and Apple does not keep their Unicode data up-to-date - at least, not the data provided for command-line tools.

Unfortunately, the Unicode consortium does not publish an authoritative version of the information terminals and terminal-based apps need to do this correctly, so if the OS vendor isn't going to provide a defacto answer, it's up to every terminal emulator and every application to invent their own variants of the standard, and hope they agree on whichever characters their users want to display.

If Kakoune invents its own Unicode database, it will take a lot of work, and it will almost certainly be incompatible with some terminal emulators on some platforms, and make interactions with tools like tmux and screen even more complex. On the other hand, sticking with the OS-provided Unicode database is a lot easier. It'll still be buggy, but at least it should be consistent with other tools.

eraserhd commented 3 years ago

@BrianHicks I'm on Catalina (10.15.4). If you are on an earlier version that would make sense, and this could be closed as a duplicate of #3059. I'll check again after I upgrade to... whatever the next major version of the OS is called?? I can't keep track, hah.

BrianHicks commented 3 years ago

Yep, I'm on Catalina as well. I've got some coworkers on the next version (Big Sur) and I'll ask them to try it!

In the mean time, I'm going to try the builtin-terminal-ui branch sometime this week and see if it helps.

eraserhd commented 3 years ago

This was just merged to master (finally, yay!), so the master branch is better to try.

BrianHicks commented 3 years ago

No joy when compiled from ac6420ee8d3a1395d358aa6f6b860e2405906c07, unfortunately. I checked and I'm actually also using Input Mono (although not Narrow.) Hmm… what else could be different between our setups? I'm drawing a blank.

eraserhd commented 3 years ago

Upgraded to Big Sur this morning, and I have the same results as before. I also used Terminal.app, and have the same results, still.

One thing, though, is that I'm copying and pasting from the github link for the emoji into Kakoune. I can't think of why that could be different than checking out that file, but try that and see what happens?

On Mon, Jul 12, 2021 at 11:13 AM Brian Hicks @.***> wrote:

No joy when compiled from ac6420e https://github.com/mawww/kakoune/commit/ac6420ee8d3a1395d358aa6f6b860e2405906c07, unfortunately. I checked and I'm actually also using Input Mono (although not Narrow.) Hmm… what else could be different between our setups? I'm drawing a blank.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/mawww/kakoune/issues/4257#issuecomment-878362328, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABD6VBYP6EL4U2CTTHXGP3TXMBBLANCNFSM5AC3M5CQ .

jamesaustin commented 2 years ago

@eraserhd here is a work around that I'm using for macOS.