| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
now I know why overloading dealloc felt wrong
|
|
|
|
|
|
|
| |
Makes it slightly easier to debug image output.
Also, we stop sending dimension headers, and no longer check for the
scheme env var to make CLI invocation a bit less annoying.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, it just changed the URL before loading the site; now it's
an actual redirect.
Technically, the previous behavior was more flexible, because it let you
apply siteconf rules exclusively for sites where you redirected from.
Practically, this was not very useful, and probably unexpected for
anybody trying to use the feature.
This also fixes a bug where the loader filter would be set for the
original page, so you couldn't switch from https to http, etc.
|
| |
|
|
|
|
|
| |
This lets us send the transparency bit as a header, and also halves the
number of header parsers in loader.
|
|
|
|
|
|
| |
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.)
|
| |
|
| |
|
|
|
|
| |
ensure that images are shown in the order buffer sent them
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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 (?)
|
|
|
|
|
| |
* fix overprint of double width chars in status & select
* fix blank screen on reload + startpos screen move
|
|
|
|
| |
still not really great, because inline background is a mess too
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
| |
* fix broken int conversion in dynstream
* fix EPIPE handling in forkserver
* merge fdmap and connectingContainers into loader map
|
|
|
|
|
| |
* reduce copies & allocations
* simplify SGR generation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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...)
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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".
|
|
|
|
|
| |
I've moved most image logic to adapter, so it doesn't really make
sense to have this subdir anymore.
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
Welp. The fence was needed after all.
The keybinding was broken anyway; fix that too.
|
|
|
|
|
|
|
|
|
| |
saveSource's URL overriding mechanism conflicted with rewrite-url,
since the latter wouldn't change the overriding URL (which was not
optional either).
Remove the former since a) it's just cosmetic and b) not really visible
to the user at all.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
std/unicode has the following issues:
* Rune is an int32, which implies overflow checking. Also, it is
distinct, so you have to convert it manually to do arithmetic.
* QJS libunicode and Chagashi work with uint32, interfacing with these
required pointless type conversions.
* fastRuneAt is a template, meaning it's pasted into every call
site. Also, it decodes to UCS-4, so it generates two branches that
aren't even used. Overall this lead to quite some code bloat.
* fastRuneAt and lastRune have frustratingly different
interfaces. Writing code to handle both cases is error prone.
* On older Nim versions which we still support, std/unicode takes
strings, not openArray[char]'s.
Replace it with "twtuni", which includes some improved versions of
the few procedures from std/unicode that we actually use.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* round down to number divisible by 6 for height
* make pager's dispw match term's dispw even after width clamping
* make *BE procs actually emit/consume big-endian (lol)
* fix borked sixel set raster attributes & control string
I mixed up SRA with the device control string's parameters, so instead
of toggling transparency in the DCS, I was setting the second SRA
parameter to 0. Which, by the way, defines the aspect ratio's
denominator, and has nothing to do with transparency. Whoops.
|
|
|
|
| |
+ be a bit more paranoid about double closes
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* stream: and passFd is now client-based, and accessible for buffers
* Bitmap's width & height is now int, not uint64
* no more non-network Bitmap special case in the pager for canvas
I just shoehorned it into the static image model, so it still doesn't
render changes after page load. But at least now it doesn't crash the
browser.
|
| |
|
|
|
|
|
|
|
|
| |
This caches sixel output. Works best when the line height is a multiple
of 6px, but should still be faster than the previous solution everywhere
else too (simply by virtue of encoding separate images in parallel).
Next step: actual color quantization
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* add responseText, response
* add net tests
-> currently sync XHR only; should find a way to do async
tests...
* update monoucha
-> simplified & updated some related code that no longer worked
properly
|
|
|
|
|
|
| |
* parse last line even if it doesn't end with LF
* parse flags & named fields case-insensitively
* update naming
|
|
|
|
| |
Dispatch manually with fromJS instead.
|
|
|
|
| |
It did not actually break rewrite-url, but was still annoying.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* xmlhttprequest: fix missing import
* painter: generic tuple workaround
* dynstream: merge module with implementations (so it will work with
vtables)
Not enabling vtables yet since it doesn't work with refc.
|
|
|
|
|
|
|
|
|
| |
* buffer, pager, config: add meta-refresh value, which makes it possible
to follow http-equiv=refresh META tags.
* config: clean up redundant format mode parser
* timeout: accept varargs for params to pass on to functions
* pager: add "options" dict to JS gotoURL
* twtstr: remove redundant startsWithNoCase
|
|
|
|
|
|
|
|
|
|
|
| |
fixes the following bug:
* click a link that redirects somewhere
* go back
* discard buffer (that had the link)
* discard the new buffer
then you would find yourself in a zombie buffer you previously discarded
|
|
|
|
|
| |
This fixes a bug where cloning buffers with images would crash the
browser.
|
|
|
|
|
|
|
|
| |
The status code & headers are no longer guaranteed to be sent right
after res/outputId, so read them asynchronously instead.
(This is pretty much the same code as the buffer connection handler in
pager. Hopefully we can merge the two at some point.)
|
|
|
|
| |
and enable it by default.
|
|
|
|
|
|
|
|
| |
It seems registerHandle/unregister doesn't accept cint as handles. Not
sure why it even works on 64-bit targets... (maybe some converter
weirdness?)
Seems best to explicitly cast it away.
|
|
|
|
|
|
| |
Fixes the bug where getting redirected to a buffer that the pager then
deleted (e.g. image display, site no longer available, etc.) would land
you in a buffer detached from the main tree.
|
|
|
|
| |
Same as [[siteconf]] autofocus.
|
|
|
|
|
|
|
|
|
|
|
| |
Saves bandwidth; it's especially useful over SSH. Still not sure if this
is the right solution, since it now needs two select cycles instead
of one, and it does yet another copy of the image. (Unnecessarily,
because stbi cannot stream its output, and stbiw cannot stream its
input.)
Also, to save memory, we now discard decoded images of buffers that are
not being viewed.
|