9 ms·
I’m embodying an archetype here, but I can’t resist. The use of QTermWidget makes this almost entirely an exercise in building a hello-world Qt app and very li
by davidad_ 9y ago
I’m embodying an archetype here, but I can’t resist.
The use of QTermWidget makes this almost entirely an exercise in building a hello-world Qt app and very little about building a terminal. That is all very well if you are looking to learn Qt—which is by no means an unworthy aim—but I wouldn’t use the adjective “minimal” to describe any Qt app, no matter how short its main().
If you are actually looking for a minimal terminal, whose source code is intelligible and readily customizable, look no further than https://st.suckless.org/ https://st.suckless.org/
- majewsky 9y agoYeah, I too was hoping for something substantital, e.g. a description of how to allocate and manage a pseudo-terminal (especially since I'll be needing that for a project of mine quite soon). I'll probably be looking at the st(1) source code, then.
- sjmulder 9y agoI was experimenting with pty's just the other day. I needed only I/O and window size updates, so it turned out fairly succinct: https://github.com/sjmulder/trickle/blob/master/tritty.c https://github.com/sjmulder/trickle/blob/master/tritty.c I'm not at all an experienced Unix programmer though so take it with a grain of salt. Would be happy to hear about any defects or possible improvements.
- sjmulder 9y agoGood suggestion! I found st a joy to read. Only a couple of C files, few frills and a straightforward coding style. I can see what the suckless folks are getting at. Slightly OT here but I was thinking about what a suckless UI system would be like - one without excessive layering and as few moving parts as possible. I'm fairly sure it should be possible by avoiding truetype fonts and using the framebuffer directly. That would preclude ubiquitous animation but smooth scrolling and dragging is perfectly doable even with a single buffer.
- racer-v 9y agoWhat would be the win in avoiding TrueType? Seems like we could easily convert any TTF files to PostScript Type 1 if there were an advantage to be gained.
- sjmulder 9y agoThis might be a misconception but I was under the impression that truetype fonts are a complexity and security minefield. In particular I noticed an st developer complaining (on the mailing list, probably) about the lack of a suckless font library when I concluded that it might be better to just do without them.
- racer-v 9y agoSounds like a noble endeavor. From https://suckless.org/project_ideas https://suckless.org/project_ideas Suckless font rendering library There is libdrw in suckless now, which still uses xft and fontconfig. Fontconfig and xft are ugly and require too much internal knowledge to be useful. The next logical layer in Linux evolved as pango and cairo. Both of course added HTML formatting and vector drawing. This is not needed to simply draw some text somewhere. And this is what a suckless font rendering library should do: Give it a font string and render at some position the given font without having to care about font specifics.
- cat199 9y agonot 100% but pretty sure the suckless folks are in the static bitmapped font camp - TTF and PS are raster formats.
- aardvark291 9y agoaren't "bitmapped" and "raster" pretty much synonymous?
- Stratoscope 9y agoThey are. cat199 no doubt meant to say that TrueType and PostScript generally use vector (outline) fonts, not raster (bitmap). They are both capable of providing bitmap fonts as well, but those are less commonly used.
- freedomben 9y agoI came out of it feeling like it was a great foundation, and ready for me to hack and customize without having to start the project from scratch. Suckless looks great tho. Thanks for the link!
- dang 9y agoOk, we swapped "minimal" for "QT" in the title above.