caughtquick has quit [Read error: Connection reset by peer]
rcf is now known as nh
nh is now known as rcf
lechner has quit [Quit: WeeChat 3.0]
lechner has joined #foot
lechner has quit [Client Quit]
lechner has joined #foot
lechner has quit [Client Quit]
lechner has joined #foot
cbb has joined #foot
cbb has quit [Quit: WeeChat 3.1]
cbb has joined #foot
cbb has quit [Client Quit]
_whitelogger has joined #foot
_whitelogger has joined #foot
_whitelogger has joined #foot
novakane has joined #foot
novakane has quit [Quit: WeeChat 3.1]
novakane has joined #foot
Guest1240 has joined #foot
Guest1240 has quit [Quit: Connection closed]
yyp has joined #foot
_whitelogger has joined #foot
ollysmith has joined #foot
_whitelogger has joined #foot
_whitelogger has joined #foot
_whitelogger has joined #foot
yyp has joined #foot
yyp has quit [Changing host]
<sterni>
dnkl: have you ever investigated the combination of fish, foot and grapheme clusters?
<sterni>
the combination breaks something in a very annoying fashion
<sterni>
which is most likely due to our refusal to implement grapheme clusters in an incorrect way, as it is working properly in e. g. kitty
<sterni>
I finally have a bit to motivation to check exactly what the problem is
<sterni>
but I am fairly sure that fish assumes grapheme clusters only take up a certain size (one cell?!), but for an emoji + presentation selector it is two cells in foot
<sterni>
stuff like this convinces me bit by bit that we really need to move past terminal emulators in the future
<dnkl>
sterni: no, I haven't. But suspects it comes down to a disagreement of what the width of the cluster is
<dnkl>
I've been considering picking up the grapheme clustering branch and adding an option to enable/disable clustering
<dnkl>
Still not sure how to handle width though
<dnkl>
Parse Unicode data files ourselves and provide our own implementation is wcswidth
<dnkl>
Might be the best option
<dnkl>
I think that's what fish does
st3r4g has joined #foot
_whitelogger has joined #foot
_whitelogger has joined #foot
<sterni>
I'll check it out
<sterni>
a thing that may already help is skipping the presentation selector altogether
<sterni>
or add an option for it?
<sterni>
this is such an annoying topic there is really no way forwards nor backwards
<dnkl>
sterni: if we just skip it, we're just as likely to emit a one-column glyph when fish expects two...
<sterni>
maybe
<dnkl>
Yeah, I think a single option to enable best-effort grapheme clustering is the way to go
<sterni>
I guess good idea is checking out the fish source code later
<sterni>
hopefully I don't put it off again
<dnkl>
I think we can get a lot of combinations to work. But presentation selectors, at least, will require plumbing all the way down to fcft
travankor is now known as DarthRasEngan
<sterni>
otoh we could just figure out what fish does differently than say GNU readline and try to patch it
<dnkl>
sterni: 'it' being foot or readline? :)
<dnkl>
the way I see it, no matter what we do, we'll break something. Whatever we do in foot to "fix" fish will break bash. And/or zsh. Or something else.
<dnkl>
that's why I think an option to enable/disable grapheme clustering is the only way. I also think doing this the "right" way, instead of trying to monkey patch foot is the right thing to do.
<dnkl>
we could even add a custom escape to switch grapheme clustering on/off, to be able to support both "old" and "new" applications in the same foot instance
novakane has quit [Quit: WeeChat 3.1]
<dnkl>
sterni: but, considering foot hasn't supported grapheme shaping at all, it would be perfectly ok to add things incrementally. No need to do *everything* correct from the beginning
novakane has joined #foot
yyp has quit [Remote host closed the connection]
yyp has joined #foot
<sterni>
dnkl: no fish
<sterni>
dnkl: I mean our initial endavour has convinced me that implementing this in a correct way is not feasible pretty much
<sterni>
it seems there is some kind of consensus among ncurses based stuff what kind of incorrect leapfrogging to do to get emojis to work to an extent
<sterni>
but my current frame of mind is more like, eh just switch to some GUI editor and don't use fish anymore
yyp has quit [Remote host closed the connection]
yyp has joined #foot
<dnkl>
sterni: my guess is doing basic grapheme clustering (instead of printing the emoji to one cell, and the selector/skin modifier/whatever to the next cell), and then using max-wcwidth-of-all-codepoints will probably take us pretty fast.
<dnkl>
But I don't see how we can get around grapheme clustering
<dnkl>
If more applications start handling grapheme clusters then foot needs to change too. Having broken grapheme cluster handling is only fine as long as all applications are broken in the same way...
<dnkl>
So, while I agree it's more or less impossible to do correctly in a terminal, we can at least try to provide support for the things that _can_ be done
<dnkl>
Or we tell people to stop using fish. But I have a feeling there will more applications that expect this to work
amk has quit [Read error: Connection reset by peer]
amk has joined #foot
_whitelogger has joined #foot
rcf is now known as blaahaj
blaahaj is now known as rcf
<dnkl>
sterni: fwiw, looks like fish just does wcswidth() on the whole grapheme cluster. But I just tested this very briefly, with a single emoji, the ๐ฉโ๐ฉโ๐งโ๐ง
<dnkl>
the fish prompt broke down when I used two cells in foot, rather than 4
<dnkl>
sterni: going to test latest fish from git, because so far, I don't see fish being any better than any other shells. Which isn't what I've been led to believe
<dnkl>
hmm, no difference
<sterni>
dnkl: I had problems today with ๐ฐ๏ธ wheras โ is fine, so I'm fairly sure that this specific issue is caused by the variant selector somehow
<dnkl>
sterni: yeah, it is. The base emoji has a wcwidth == 1, and the selector has wcwidth == 0. But we want wcwidth=2. And yeah, it does appear fish understands this, as this particular case works fine in kitty
<dnkl>
grapheme clustering by itself wont help here, but tweaking our width calculation will
<dnkl>
sterni: anyway, I've resurrected the grapheme clustering branch. Will see what I can do about the width calculation.
<sterni>
dnkl: the double width character lie comes back to haunt us
<sterni>
I wonder why ppl introduced this in the first place a double width glyph is such an odd concept
<dnkl>
sterni: I believe they initially were single width. Some fonts still have them as single-width glyphs. But to then suddenly render them as double width... obviously they who thought that was a good idea weren't terminal emulator users... :)
<sterni>
dnkl: does the (glibc) wcswidth(string) == cells occupied in foot invariant hold currently?
<sterni>
dnkl: yeah well honestly I am more inclined to blame whoever started to emulate this behavior with terminal emulators
<sterni>
instead of forcing the glyphs into single cells
<dnkl>
sterni: about wcswidth, yes, also in the resurrected grapheme clustering branch
<dnkl>
Except when we see an emoji variant selector
<dnkl>
Then we hardcode it to 2 ๐
<dnkl>
sterni: hmm, except that in master we don't do clustering, so we never call wcswidth on a string of characters. Only wcwidth in single codepoints
<sterni>
do we reserve two cells for codepoints with wcwidth == 2?
vicvbcun has joined #foot
<dnkl>
Yup
<dnkl>
But note that zero-width characters can be appended to the previous cell. This is mainly to deal with composed characters, not emoji sequences