πŸ’Ύ Archived View for bbs.geminispace.org β€Ί u β€Ί lufte β€Ί 1571 captured on 2023-09-08 at 18:56:05. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-07-22)

➑️ Next capture (2023-09-28)

🚧 View Differences

-=-=-=-=-=-=-

Re: "ANSI formatting What do you think of the use of ANSI..."

Comment in: s/Gemini

@mbays I think I understood option 4 as "Ban capsule owners from writing special codes in their document" instead of "force clients to not do any special handling with the text in pre blocks", which makes more sense. In that case I'm all for option 4.

πŸš€ lufte

2023-06-05 Β· 3 months ago

Poll Results

1. ANSI formatting is neat and should be considered part of gemtext. Clients should support it.

β–ˆβ–ˆβ–ˆβ–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β– 14%

2. ANSI formatting is awkward but we don't need to ban it... servers can send it and clients may display it, but they shouldn't be expected to.

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–β–β–β–β–β–β–β–β–β–β– 51%

3. Like option 2, but it should only be tolerated within preformatted text; elsewhere clients SHOULD strip all ANSI escape codes.

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β– 22%

4. ANSI formatting is an abomination, and should be explicitly disallowed in the spec. Real gemtext does not contain any such escape codes, and clients should of course strip any they find.

β–ˆβ–ˆβ–ˆβ–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β–β– 14%

5. Other, see comment.

▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁ 0%

37 votes were cast.

5 Later Comments ↓

πŸš€ skyjake

@mbays I agree it's SGR that makes most sense here, but I think because actually adding support for these codes is highly implementation dependent (for instance, can be much easier for a TUI app), there should be no common baseline of expected support. The only common denominator should be that clients strip out the sequences, if they can't parse and apply them properly.

But IMO even that is too complicated a requirement for implementing a Gemtext parser. My speccing suggestion is to simply not pass control characters like <ESC> through to disable these sequences, even when the client just dumps the source to a terminal.

Allowing SGR in preformatted blocks makes some sense because there one might reasonably expect a client to take the part of the source between the ``` markers and show it as-is (inside a terminal emulator).

The way GUI clients would render the codes depends greatly on the underlying display method. A web view has powerful CSS styling features, so once you parse the sequence, you can display it easily. Other GUI controls might be more limited in what they can render. In any case, the client would have to be smart about the presentation, by choosing colors and fonts that remain legible.

It's all a surprising amount of complexity when implemented properly, however I think it's still compatible with the idea that the client is empowered to present the Gemtext source as it sees fit.

❄ freezr

I believed this topic was already settled down, and we eventually agreed it was a bad idea especially because text-readers read the full text...

πŸš€ mbays

@skyjake Right yes, it's best to have the baseline behaviour lead to something unreadable when escape sequences are used, discouraging their use except in dynamic systems where the user has specifically opted in to receiving them.

That doesn't mean we can just leave optional use of escape sequences unspecced and let conventions around them build up, because that's a definite loophole for extending the capabilities of gemini. So I think we have to tightly constrain what's permitted. Hopefully Solderpunk will pronounce on it one day.

2023-06-06 Β· 3 months ago

πŸš€ totroptof

There is a π˜₯𝘦 𝘧𝘒𝘀𝘡𝘰 standard ANSI sequence that provides a little bit more utility than SGR: VTE ([and a bunch of other terminals]) support inline hyperlinks with OSC 8. There’s a [rough spec] available as a Github Gist. I’m not sure how widely used it is, but I have noticed GCC using it to link to documentation about warnings (for example).

I’m not really advocating that ANSI sequences in general and OSC 8 in particular be widely adopted so we can have inline links, I just thought I would mention it because it’s kinda neat (and it tickles that β€œhow can I exploit this to do something interesting” itch πŸ™‚).

β€” and a bunch of other terminals

β€” rough spec

2023-06-25 Β· 2 months ago

πŸš€ mbays

@totroptof Oof... thanks. That's a serious extensibility hole which I wasn't aware of at all. OK, so this is a great argument for making sure terminal gemini clients strip out most (at least all non-CSI) escape sequences, and for having the spec tightly constrain which, if any, sequences may not be stripped.

By the way, after the discussion in this thread, I tweaked how my terminal client diohsc handles this: as of the next version, escape characters in gemtext are filtered out except where they introduce CSI sequences ('[') within a preformatted block.

Original Post

πŸŒ’ s/Gemini

ANSI formatting What do you think of the use of ANSI formatting (for colour and emphasis) in gemtext? This is one of those cases where the current spec is silent. A tradition of using these escape sequences in certain circumstances has built up, popularised (and pioneered?) by Astrobotany, and later Wordo. It worked with some terminal clients just because they didn't think to strip the escape codes, and some graphical clients (Lagrange at least) then...

πŸ’¬ mbays Β· 19 comments Β· 1 like Β· 2023-06-04 Β· 3 months ago Β· πŸ—³οΈ