dnkl changed the topic of #foot to: Foot - fast, lightweight and minimalistic Wayland terminal emulator || 1.20.2 || https://codeberg.org/dnkl/foot || channel logs: https://libera.irclog.whitequark.org/foot
ciara has quit [Ping timeout: 252 seconds]
mtm has quit [Ping timeout: 252 seconds]
boomboxnation has joined #foot
mtm has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
<baltazar> dnkl: note: you don't need to bump pkgver in -git aur packages, and in this case it won't even work as it always builds the master branch (but 1.20.2 is not on it)
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
qyliss has quit [Quit: bye]
qyliss has joined #foot
qyliss has quit [Remote host closed the connection]
qyliss has joined #foot
bitblt has quit [Ping timeout: 252 seconds]
OtzmaVin1 has joined #foot
OtzmaVindicus has quit [Remote host closed the connection]
bitblt has joined #foot
OtzmaVin1 has quit [Quit: levaya]
OtzmaVindicus has joined #foot
alexherbo2 has joined #foot
<ovf> exploring the wonderful world of terminal programming, i'm trying to implement a line editor that always has the same idea of text width as the terminal. as a first approximation, i can keep asking for current cursor position with dsr (csi 6 n) and maintain a mapping. however, i don't understand foot's (and presumably others) approach to double-size unicode stuff, like 🏴‍☠️ (which foot renders as a single pirate flag)
<ovf> it's probably a tired debate at this point, but i can't figure out even the conceptual behaviour of my editor+foot, given that this thing is taking two cells (or one double-size cell? how do i even ask the terminal about that?)
<dnkl> you can't ask the terminal. your only option right now is to print the character and then check the cursor position
<dnkl> fwiw, foot uses utf8proc to determine character widths, meaning it's Unicode compliant. So in theory all you need to do is to ensure you're compliant as well
alexherbo2 has quit [Remote host closed the connection]
<dnkl> there's one quirk though; all functions I'm aware of, that measures width, don't handle grapheme clusters correctly (i.e single glyphs consisting of multiple code points). By default, foot always assigns such glyphs the width 2
<ovf> yes, 'print and check' is what i'm doing. the basic idea is just to always do whatever the terminal does (because other things like gnu readline try to second guess and come out wrong, due to the different implementation decisions, or quirks as you call them)
<ovf> but still i think that doesn't tell me what a backspace/^h should do after a grapheme cluster (again, i think i don't care about unicode correctness -- it's the terminal's job -- i just want to be kept in sync with it)
<ovf> of course in the ideal world, any terminal would have an 'edit line' mode and a line editor wouldn't be needed. :-)
<dnkl> from the terminal perspective, a backspace just moves the cursor. It's up to you what to do in response to a backspace key press. I would move it two cells back, on case of a double width glyph
<ovf> except that there's no way to know foot thought it was a double width glyph, right? the pirate flag is especially treacherous because its first codepoint is a normal glyph, so at this point foot will move one cell to the right. the next two codepoints result in that glyph becoming a double-width one, so to me doing 'print and check' this looks indistinguishable from a normal two-glyph string?
<dnkl> yes, you can't check the cursor after each byte written, but after each grapheme cluster written. that means you have to be "Unicode aware", and parse grapheme breakpoints etc
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
<ovf> which pretty much defeats the point of the exercise, i guess, because different terminals will behave differently here, and my editor basically has to reimplement the relevant logic from each one of them
<dnkl> there's an escape implemented by a few modern terminals that indicate whether they do proper Unicode processing
<dnkl> terminals that don't implement that particular escape should still reply to a query for it
mtm has quit [Ping timeout: 260 seconds]
<ovf> thanks! does foot do it?
<ovf> btw on the foot side, i guess the only way to know the actual width of unicode text is to ask your shaper (harfbuzz via fcft in your case?). whenever i see those blog posts comparing the string length functions in various languages, i always wonder why nobody suggested defining one based on shaped text. :-)
diaspora392 has quit [Remote host closed the connection]
mtm has joined #foot
diaspora3928 has joined #foot
<ovf> i see you have actually written out most of what we've discussed above in the changelog entry for 1.8.0 (with the max-two change having landed in 1.8.1)
kode54 has quit [Quit: The Lounge - https://thelounge.chat]
kode54 has joined #foot
<dnkl> ovf: yes, foot "does it", including implementing the query escape. on the phone right now, don't remember the exact escape...
cbb has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
<rockorager> It's private mode 2027
<rockorager> ovf: generally you'll want a unicode library that tells you the monospace width of a string. You can calculate this yourself if you only can get it for a single codepoint too, but you still need to segment by graphemes so you can find things like emoji modifiers
<rockorager> If a terminal supports mode 2027, turn it on and use the result of that library as the width
<rockorager> If it doesnt, the terminal will instead calculate the width based only on the individual codepoints (ie, just segment by codepoints and each codepoint has a width)
<rockorager> There is one exception: kitty has mid-tier support - it gets everythign right except if there is a ZWJ, in which case it ignores the ZWJ
<rockorager> So kitty will get things like the country flags correct, but pirate flags wrong
<cbb> there is no "wrong" when it comes to ZWJ sequences is there?
<cbb> aren't they all "reccomendations" rather than standard?
<cbb> and it's legal to define implementation-specific ones, that terminal client apps have no good way of discovering
<rockorager> I thing Unicode literally says a zero width joiner combines the preceding and next codepoint into a single glyph, meaning the size doesn’t increase
<rockorager> But yeah the fallback says that you could so it decomposed too
<cbb> there's no good way for a client to know which will be used though
<cbb> other than the list of recommended sequences
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
OtzmaVindicus has quit [Remote host closed the connection]
OtzmaVindicus has joined #foot
<cbb> I didn't mention that to nitpick btw... I'm just quite interested to hear other people's thoughts on that subject
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
rptbunny has joined #foot
<rptbunny> Hello. Just upgraded from older version of foot to 1.20.1 and trying to replace my notify command; what would be the equivalent of `notify=notify-send -a ${app-id} -i ${app-id} ${title} ${body}` for the new `desktop-notifications.command`?
<rockorager> make a new section called [desktop-notifications], then put that line under it, but as `command=` instead of `notify=`
<rptbunny> I'm stupid. Thanks.
<rptbunny> I was thinking "what in the world am I supposed to do with this OSC 777 stuff", reading foot-ctlseqs(7)
boomboxnation has quit [Read error: Connection reset by peer]
rptbunny has quit [Quit: leaving]
boomboxnation has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
boomboxnation has quit [Remote host closed the connection]
boomboxnation has joined #foot
cbb has quit [Quit: cbb]
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]
boomboxnation has joined #foot
esu has joined #foot
boomboxnation has quit [Read error: Connection reset by peer]