Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kitty terminal misrendering after running hledger-ui #2126

Open
simonmichael opened this issue Dec 7, 2023 · 4 comments
Open

kitty terminal misrendering after running hledger-ui #2126

simonmichael opened this issue Dec 7, 2023 · 4 comments
Labels
platform:linux ui The hledger-ui tool.

Comments

@simonmichael
Copy link
Owner

Moved here from #2112.

@the-solipsist> I'm having trouble with hledger-ui / hledger-iadd and kitty terminal, and I think it might be because of brick/vty. Would anyone be in a position to confirm if this is the case?

@ShrykeWindgrace> @the-solipsist in order to answer your question, we will need quite a list of things:

  1. versions of hledger-ui/hledger-iadd you use

Then, if the answer to the first question is not "I use the custom build of these tools with vty-6 and brick-2", I suggest you open a separate issue in hledger.

Afterwards, this info is needed, too:

  1. version of kitty (most probably I won't be able to test that terminal emulator for quite some time)
  2. your fonts
  3. MWE for your workflow reproducing the bug
  4. optionally, an attempt to reproduce the bug in another terminal emulator (st/wezterm/foot/konsole/gnome_terminal/whatever you have access to). If the bug is no longer present, then the problem is most probably is in kitty or in your config of kitty.

@the-solipsist> 1. Hledger versions:

hledger --version && hledger-ui --version && hledger-iadd --version
hledger 1.32, linux-x86_64
hledger-ui 1.32, linux-x86_64
This is hledger-iadd version 1.3.19

These were installed from the Arch User Repository, using hledger-bin, hledger-iadd-bin, etc., which in turn use the Github builds of hledger, hledger-ui, hledger-iadd, etc.

  1. Kitty version:
kitty --version
kitty 0.31.0 created by Kovid Goyal
  1. Kitty fonts
kitty --debug-font-fallback
[341 10:55:57.150940] Preloaded font faces:
[341 10:55:57.150977] normal face: /usr/share/fonts/noto/NotoSansMono-Regular.ttf:0
[341 10:55:57.150998] bold face: /usr/share/fonts/noto/NotoSansMono-Bold.ttf:0
[341 10:55:57.151014] italic face: /usr/share/fonts/noto/NotoSansMono-Regular.ttf:0
[341 10:55:57.151031] bi face: /usr/share/fonts/noto/NotoSansMono-Bold.ttf:0
[341 10:55:57.305236] [glfw error 65544]: process_desktop_settings: failed with error: [org.freedesktop.DBus.Error.UnknownMethod] No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
  1. Reproducing the bug:
  • Run hledger bal on a file with the symbol. The symbol shows fine.
  • Open hledger-ui. Close hledger-ui.
  • Run hledger bal again on the same file. The symbol is corrupted.
  1. The bug isn't present in Gnome Console (which is why I thought the bug is with Kitty).

@ShrykeWindgrace> @the-solipsist And what's the value of TERM in both cases?

@simonmichael could you move the thread on kitty to a separate issue? It has nothing to do with vty-6 or brick-2. If there is no automatic option, I'll be able to simply copy all comments by hand, no trouble.

@ShrykeWindgrace
Copy link

I could test kitty briefly today:

$ kitty --version
kitty 0.31.0 created by Kovid Goyal
$ hledger-ui --version
hledger-ui 1.30, linux-x86_64
$ hledger --version
hledger 1.30.1, linux-x86_64
$ echo $TERM
xterm-kitty
$ kitty --debug-font-fallback
[348 14:50:21.106885] Preloaded font faces:
[348 14:50:21.106914] normal face: /usr/share/fonts/truetype/noto/NotoSansMono-Regular.ttf:0
[348 14:50:21.106921] bold face: /usr/share/fonts/truetype/noto/NotoSansMono-Bold.ttf:0
[348 14:50:21.106928] italic face: /usr/share/fonts/truetype/noto/NotoSansMono-Regular.ttf:0
[348 14:50:21.106933] bi face: /usr/share/fonts/truetype/noto/NotoSansMono-Bold.ttf:0

... and I do not reproduce the problem. Admittedly this is not the same version of of hledger, but I highly doubt anything relevant changed between these two versions.

You might want to run this test utility in your kitty: https://github.com/jtdaugherty/vty-crossplatform/blob/main/vty-crossplatform.cabal#L90. Depending on the results, we will have a better idea on what where goes wrong in your case. I strongly suspect that hledger has nothing to do with your problems.

@the-solipsist
Copy link
Collaborator

Thanks for checking, @ShrykeWindgrace.

I can reproduce the same problem even with older versions of hledger-ui (I tried 1.30). But I cannot reproduce the problem with other TUI programs like mc or nmtui, nor can I reproduce it with any terminal emulator other than kitty.

There's one small difference between your output for kitty --debug-font-fallback and mine (the glfw error), but I'm not sure if it's significant:

sol@spica ~> kitty --debug-font-fallback
[349 16:20:04.895691] Preloaded font faces:
[349 16:20:04.895729] normal face: /usr/share/fonts/noto/NotoSansMono-Regular.ttf:0
[349 16:20:04.895741] bold face: /usr/share/fonts/noto/NotoSansMono-Bold.ttf:0
[349 16:20:04.895751] italic face: /usr/share/fonts/noto/NotoSansMono-Regular.ttf:0
[349 16:20:04.895761] bi face: /usr/share/fonts/noto/NotoSansMono-Bold.ttf:0
[349 16:20:05.525960] [glfw error 65544]: process_desktop_settings: failed with error: [org.freedesktop.DBus.Error.UnknownMethod] No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop

As for vty-interactive-terminal-test, I have installed a binary version of hledger{...} and haven't built it. Haskell in Arch is a nightmare, plus cabal/stack takes a lot of space. So unless there's a simple way of running vty-interactive-terminal-test without cabal/stack, I'm not inclined to do so. If I temporarily install haskell-vty will I be able to run that test?

@ShrykeWindgrace
Copy link

Judging by the contents of that package - no, I don't think so. There are two demos however - vty-demo and vty-mode-demo, but IIRC they do nothing fancy with unicode, just showcase main features of vty.

The only thing I can think of that does require writing custom scripts and compiling code on your machine: what's the value of $TERM? Do you have the corresponding terminfo entry installed?

Other than that, I scrolled though kovidgoyal/kitty#6718, did you try to setup an entirely different fallback font (that also has all the characters that you need) and test whether the problem persists?

@the-solipsist
Copy link
Collaborator

Yes, I tried with the default (i.e., no font specified in the kitty config file), which is Noto Sans Mono, and I also tried specifying Fira Code in the kitty config file.

In both cases, I get the same results (though with the kitty --debug-font-fallback showing Noto Sans Mono and Fira Code as the fonts, respectively).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:linux ui The hledger-ui tool.
Projects
None yet
Development

No branches or pull requests

3 participants