hledger
hledger copied to clipboard
kitty terminal misrendering after running hledger-ui
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:
- 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:
- version of
kitty(most probably I won't be able to test that terminal emulator for quite some time)- your fonts
- MWE for your workflow reproducing the bug
- 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
kittyor in your config ofkitty.@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.19These were installed from the Arch User Repository, using
hledger-bin,hledger-iadd-bin, etc., which in turn use the Github builds ofhledger,hledger-ui,hledger-iadd, etc.
- Kitty version:
kitty --version kitty 0.31.0 created by Kovid Goyal
- 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
- Reproducing the bug:
- Run
hledger balon a file with the₹symbol. The₹symbol shows fine.- Open
hledger-ui. Closehledger-ui.- Run
hledger balagain on the same file. The₹symbol is corrupted.
- 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
TERMin both cases?@simonmichael could you move the thread on kitty to a separate issue? It has nothing to do with
vty-6orbrick-2. If there is no automatic option, I'll be able to simply copy all comments by hand, no trouble.
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.
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?
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 https://github.com/kovidgoyal/kitty/discussions/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?
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).