about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
* loader: send headers for tocache requests toobptato2024-09-286-45/+45
| | | | | This lets us send the transparency bit as a header, and also halves the number of header parsers in loader.
* gopher: do not depend on libcurlbptato2024-09-287-81/+219
| | | | | | | | I'm thinking of making libcurl entirely optional; let's start with the easiest part. I've added a SOCKS5 client for ALL_PROXY support; I know curl supported others too, but whatever.
* loader: clean up connecterrorbptato2024-09-289-104/+123
| | | | | | * allow string values for public errors * remove unused errors * update naming
* container: fix control char displaybptato2024-09-287-53/+29
| | | | | | Also, kill twidth and its friends; we haven't been using it for a while now. (In the future, a solution with PUA chars might be worth exploring.)
* container: don't show hover type on ubptato2024-09-272-2/+1
| | | | it's a waste of space, and doesn't work well with showFullAlert
* sandbox: allow restart_syscallbptato2024-09-271-1/+3
| | | | required for poll
* layout: fix wrong padding offsetsbptato2024-09-274-54/+51
| | | | + some misc refactorings
* sixel: reset chunk on transparencybptato2024-09-271-0/+1
| | | | this was causing weird artifacts
* poll: unset unused fds in registerbptato2024-09-271-0/+3
|
* Update docsbptato2024-09-266-227/+504
|
* Fixes for FreeBSDbptato2024-09-263-6/+6
|
* loader, pager: fix fd leaksbptato2024-09-252-0/+5
|
* color: fix a parseLegacyColor bugbptato2024-09-251-5/+6
|
* dynstream: fix mmap bugsbptato2024-09-251-12/+16
| | | | ugh
* buffer: make non-button form-associated elems clickablebptato2024-09-251-3/+2
| | | | | d7085253b7 was too strict; in particular, it broke cases where copyable text is placed in text areas.
* term: prevent negative line damage, fix off by onebptato2024-09-253-11/+15
|
* dom: invalidate shared images on loadbptato2024-09-251-0/+1
| | | | fixes the race where reused images wouldn't show up after page load
* pager: make image ordering deterministicbptato2024-09-253-5/+7
| | | | ensure that images are shown in the order buffer sent them
* sixel: support transparencybptato2024-09-249-74/+90
| | | | | | | | | | | | | | | | | | Sixel can only represent transparency for fully transparent (alpha = 0) and fully opaque (alpha = 255) pixels, i.e. we would have to do blending ourselves to do this "properly". But what do you even blend? Background color? Images? Clearly you can't do text... So instead of going down the blending route, we now just approximate the 8-bit channel with Sixel's 1-bit channel and then patch it up with dither. It does look a bit weird, but it's not *that* bad, especially compared to the previous strategy of "blend with some color which hopefully happens to be the background color" (it rarely was). Note that this requires us to handle transparent images specially in term. That is, for opaque ones, we can leave out the "clear cells affected by image" part, but for transparent ones, we must clear the entire image every time.
* select: use a separate module (again)bptato2024-09-244-351/+374
| | | | | | | | | Now we dispatch to select objects from the pager object too, just to make things even more confusing. Well, it works better than the previous arrangement, in that trying to use unimplemented movements now just throws instead of moving around the container. Yay for OOP (?)
* pager: fix double-width overprint & reload blank screen bugbptato2024-09-242-8/+17
| | | | | * fix overprint of double width chars in status & select * fix blank screen on reload + startpos screen move
* sixel: use inline background for blendingbptato2024-09-246-6/+13
| | | | still not really great, because inline background is a mess too
* buffer: allow button nested in abptato2024-09-241-0/+4
| | | | for compatibility with other browsers...
* Replace std/selectors with pollbptato2024-09-2314-303/+316
| | | | | | | | | | | | std/selectors uses OS-specific selector APIs, which sounds good in theory (faster than poll!), but sucks for portability in practice. Sure, you can fix portability bugs, but who knows how many there are on untested platforms... poll is standard, so if it works on one computer it should work on all other ones. (I hope.) As a bonus, I rewrote the timeout API for poll, which incidentally fixes setTimeout across forks. Also, SIGWINCH should now work on all platforms (as we self-pipe instead of signalfd/kqueue magic).
* client, forkserver, dynstream: misc refactorings, fixesbptato2024-09-237-101/+107
| | | | | | * fix broken int conversion in dynstream * fix EPIPE handling in forkserver * merge fdmap and connectingContainers into loader map
* term: refactorbptato2024-09-233-145/+160
| | | | | * reduce copies & allocations * simplify SGR generation
* loader: mmap intermediate image files, misc refactoringbptato2024-09-2220-202/+455
| | | | | | | | | | | | | | | | | | | | | | | | | | | * refactor parseHeader * optimize response blob() * add direct "to cache" mode for loader requests which sets stdout to a file, and use it for image processing * move image resizing into a separate process * mmap cache files in between processing steps when possible At last, resize is no longer a part of image decoding. Also, it feels much nicer to keep encoded image data in the same cache as everything else. The mmap operations *should* be more efficient than copying the whole RGBA data through a pipe. In practice, it only makes a difference for loading (well, now just mmapping) the encoded image into the pager, where it singlehandedly speeds up image display by 10x on my test image. For the other steps, the unfortunate fact that "tocache" must delay the next fork/exec in the pipeline until the entire image is processed seems to equal out any wins we might have gotten from skipping a single raw RGBA copy. I have tried moving the delay before the exec (it's possible with yet another pipe), but it didn't help much and made the code much uglier. (Not that tocache didn't, but I can live with this...)
* pager: improve hover text handlingbptato2024-09-228-67/+136
| | | | | | | | | | | * align status truncating behavior with w3m (not exactly, clipping is still different, but this should be fine for now) * add "su" for "show last alert" - w3m's solution here is to scroll one char at a time with "u", but that's extremely annoying to use. We already have a line editor that can navigate lines, so reuse that instead. * fix peekCursor showing empty text * update todo
* client: seqify fdmapbptato2024-09-221-4/+6
|
* layout: remove line-heightbptato2024-09-216-77/+20
| | | | | This was a bad idea that, despite my best efforts, never worked properly.
* twtstr: simplify integer parsingbptato2024-09-211-86/+65
| | | | | | * simplify uint parser * use uint parser for signed ints too (to simplify overflow handling) * use openArray[char] where possible
* toml: fix casingbptato2024-09-211-12/+12
|
* Update monouchabptato2024-09-172-6/+6
| | | | I meant to fix this enum bug in the previous patch but then I forgot...
* dom: add forms, elements getter + misc fixesbptato2024-09-179-104/+186
| | | | | | | | | | | | * add document.forms * add form.elements * remove redundant jshasprop functions * use mpairs for attribute iteration (mpairs use pointers, but pairs copies) * fix remove() crash * fix remove() collection invalidation for children (if parent is not in the collection) * update monoucha
* sandbox: always allow epoll_pwaitbptato2024-09-151-1/+1
| | | | looks like it's also necessary for musl
* loader: fix rbtCache racebptato2024-09-153-36/+49
| | | | | | | | | | | | | | | I thought this would work fine, but then images weren't loading. Upon closer inspection I realized we don't necessarily let the image decoder finish reading the entire file on pass 1 (header parsing), which means pass 2 (decoding) can end up reading a partially downloaded cache file. To fix this, we now fall back to streaming mode when an open handle to the cached item still exists. (An alternative would be to wait for the cached item to finish loading, but that's harder to implement and might be slower anyway - the current implementation allows for the decoder to run while an image is still being loaded, but we couldn't do that with the second approach.)
* blob: make size signed intbptato2024-09-153-11/+11
| | | | it was already being treated as such
* loader: refactor/move around some procsbptato2024-09-1511-743/+763
| | | | | | | | | | | | | | Module boundaries didn't make much sense here either. Specifically: * loader/cgi was originally just one of the many "real" protocols supported by loader, so it was in a separate module (like the other ones). Now it's mostly an "internal" protocol, and it was getting cumbersome to pass all required loader state to loadCGI. * The loader interface has grown quite large, but there is no need for (or advantage in) putting it in the same module as the implementation. Now CGI is handled by loader, and the interface is in the new module "loaderiface".
* Refactor img/*bptato2024-09-1515-274/+264
| | | | | I've moved most image logic to adapter, so it doesn't really make sense to have this subdir anymore.
* Update to Unicode 16.0.0bptato2024-09-145-12883/+13155
|
* loader: improve map interfacebptato2024-09-143-22/+25
| | | | directly accessing map was a bit too error prone
* loader: refactor, misc optimizations & fixesbptato2024-09-149-266/+334
| | | | | | | | * factor out input/output handle tables; use a seq instead * add possibility to directly open cached items onto stdin (mainly an optimization for reading images, which are always cached) * close used handles on local CGI execution * make clone during load work again
* sandbox: stricter fcntl policybptato2024-09-141-4/+17
| | | | fcntl has some cursed commands that we really don't want to allow
* renderdocument: fix image background coloringbptato2024-09-131-13/+16
| | | | special case it in paintBackground so that it doesn't look so ugly
* term: improve damage tracking, special case yaftbptato2024-09-132-15/+42
| | | | | | | It still sucks, but at least now it flashes a bit less. (I should really redo it properly some time) Also, special case yaft so that we always output sixels for it.
* Update docsbptato2024-09-132-23/+64
|
* sixel: do not reserve palette entry for transparencybptato2024-09-122-12/+15
| | | | | | | | | Turns out this isn't actually needed. Which makes sense, as transparency doesn't have a color register at all - it's just the default state of pixels. Also, skip octree-based quantization with palette <= 2; unsurprisingly, monochrome gives much better results.
* sixel: factor out root node, fix a bugbptato2024-09-121-30/+31
|
* sixel: small optimizationsbptato2024-09-111-31/+48
| | | | | | | | * Reduce unnecessary branch allocation even more * Use linked lists to represent sixel bands Also inlined octree-based getColor for clarity, although the compiler was already doing that.
* sixel: faster quantizationbptato2024-09-111-80/+92
| | | | | | | | | | | Reduce eager allocation of whole branches for leaves; now it's done only after the first conflict (or repeated color). This makes quantization ~2x faster for images without large runs of the same color and ~2x slower for images with a lot of those. No noticeable loss in quality. I also disabled refc for the octree and turned the nodes into tagged unions, which again resulted in a ~2x speedup.