about summary refs log tree commit diff stats
path: root/src/local
Commit message (Collapse)AuthorAgeFilesLines
* client: remove redundant global functionsbptato2024-07-161-22/+0
| | | | these are already defined on Window
* timeout: simplify, misc fixesbptato2024-07-161-7/+7
| | | | | | Merge timeout & interval code paths. This fixes clearTimeout not clearing intervals.
* term: image sizing fixesbptato2024-07-161-8/+39
| | | | | | * add sixel max width/height query * add cell size query (it's more accurate than dividing window size when you change xterm font size)
* config: support smart casebptato2024-07-161-4/+1
| | | | and enable it by default.
* 32-bit compilation fixesbptato2024-07-132-9/+9
| | | | | | | | 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.
* timeout: fix jsvalue leakbptato2024-07-101-0/+1
|
* lineedit: small cleanupbptato2024-07-071-4/+1
|
* pager: fix redirection to deleted buffersbptato2024-07-062-5/+19
| | | | | | 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.
* main, forkserver: optimize startupbptato2024-07-061-9/+2
| | | | | Merge "load config" with "fork loader", so that the loader process gets forked one packet earlier.
* config: add buffer.autofocusbptato2024-07-041-0/+1
| | | | Same as [[siteconf]] autofocus.
* term: fix excessive SGR output in ansi color modebptato2024-07-021-17/+21
|
* term: query default ansi colors, etc.bptato2024-07-021-63/+94
| | | | | * query default ANSI colors with OSC 4 * disable queries overridden by config
* pager: PNGify kitty images, clear images on buffer switchbptato2024-07-023-28/+73
| | | | | | | | | | | 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.
* promise, container: fix nil derefsbptato2024-06-301-1/+3
|
* term: fix sixel OOBbptato2024-06-291-1/+1
| | | | x is clamped to 0, so there is no need to offset it by offx.
* dom, pager: cache images from networkbptato2024-06-293-33/+44
| | | | | | | | | | | With many limitations: * slightly randomized expiry, so it's harder to fingerprint * only images. so e.g. CSS is still left uncached * it's per-buffer and non-persistent, so images are still redownloaded for every new page load so it's more of an image sharing between placements than true caching.
* config: add various missing optionsbptato2024-06-291-3/+4
| | | | | | | Mainly things you could already set with [[siteconf]] but not normally. Also, a `styling' option to disable author styles. Also, `images' is now documented as an "experimental" option, since it's halfway usable now.
* img, loader: add image resizing, misc fixesbptato2024-06-281-12/+33
| | | | | | | | | | | | | | | * resize images with stb_image_resize * use tee for output handle redirection (redirectToFile blocks) * cache original image files * accept lseek in sandbox * misc stbi fixes For now, I just pulled in stb_image_resize v1. v2 is an extra 150K in size, not sure if it's worth the cost. (Either way, we can always switch later if needed, since the API is almost the same.) Next step: move sixel/kitty encoders to CGI, and cache their output in memory instead of the intermediate RGBA representation.
* config: fix JS command definitionsbptato2024-06-231-2/+3
|
* term: fix negative line damage bugbptato2024-06-231-4/+2
|
* misc cleanupsbptato2024-06-224-9/+6
|
* pager: fix nil deref in dupeBufferbptato2024-06-221-15/+18
|
* pager: refactor drawing codebptato2024-06-226-503/+536
| | | | | | | * merge select into container * avoid unnecessary redraws in draw() for parts of the screen that haven't been updated * various image redraw fixes
* term, pager: improve image displaybptato2024-06-213-95/+213
| | | | | | * basic repaint algorithm for sixel (instead of brute force "clear the whole screen") * do not re-send kitty images already on the screen
* client, pager: fix cached item refcounting bugsbptato2024-06-213-14/+30
|
* img, term: try to detect unknown images, improve kitty encoderbptato2024-06-211-19/+17
| | | | | | * preserve alpha in kitty + simplify encoder * pass unknown image types to stbi (as image/x-unknown) and let it detect the type
* img, loader: separate out png codec into cgi, misc improvementsbptato2024-06-204-12/+46
| | | | | | | | | | | | | | | * multi-processed and sandboxed PNG decoding & encoding (through local CGI) * improved request body passing (including support for output id as response body) * simplified & faster blob()/text() - now every request starts suspended, and OngoingData.buf has been replaced with loader's buffering capability * image caching: we no longer pull bitmaps from the container after every single getLines call Next steps: replace our bespoke PNG decoder with something more usable, add other decoders, and make them stream.
* pager: prefill lmUsername with current usernamebptato2024-06-161-1/+1
|
* Update Chame, Chagashibptato2024-06-132-15/+18
|
* pager: actually fix broken logicbptato2024-06-091-2/+2
| | | | | | | | ok we block if: * method is not GET * scheme is different * it is not the case that both the current and the target schemes are http/s
* pager: fix broken logicbptato2024-06-091-3/+3
| | | | bleh
* dom: simplify window.loaderbptato2024-06-091-4/+1
| | | | the Option setup hasn't made much sense for a long time now
* pager: send Accept: */* for viewImagebptato2024-06-081-2/+7
|
* buffer: add autofocusbptato2024-06-082-63/+60
| | | | naturally, it's opt-in
* pager, buffer: improve forms, protocol configbptato2024-06-082-17/+23
| | | | | | * refactor form submission * add options to specify form handling per protocol * block cross-protocol POST requests
* Move JS wrapper into Monouchabptato2024-06-035-24/+27
| | | | Operation "modularize Chawan somewhat" part 3
* pager: rework D/discard bufferbptato2024-05-311-47/+126
| | | | | | | | | | | | | | | | | | | | | The previous solution had the issue that it switched between "delete buffer, then move back" and "delete buffer, then move forward" depending on whether the buffer was the root of the buffer tree, which made its behavior quite unpredictable. Now the pager (sort of) remembers the direction you are coming from, and D moves in that direction. So e.g.: * Enter, D just moves back to where you were coming from (as before) * Comma, D deletes the previous buffer, then returns to the current buffer If no buffer exists in the target direction, then we alert. Also, new commands are: `d,' `d.'. They do the same thing the non-d-prefixed variations do, but also delete the current buffer. Useful if you're no longer sure where you are coming from, but know where you want to go. (`d,' in particular is equivalent to w3m's `B'.)
* client: fix double click on double width charsbptato2024-05-231-7/+7
| | | | | This is not a perfect solution, but it's still better than not being able to double click on CJK links correctly.
* html: improve Request, derive Client from Windowbptato2024-05-203-23/+20
| | | | | | | * make Client an instance of Window (for less special casing) * misc work on Request & fetch * improve origin comparison (opaque origins of same URLs are now considered the same)
* config: separate tmp dir for sockets, usersbptato2024-05-161-4/+5
| | | | | | | * add $LOGNAME to the tmp directory name, so that tmpdirs of separate users don't conflict * use separate directory for sockets, so that we do not have to give buffers access to all cached pages
* pager: editor command fixesbptato2024-05-121-2/+2
|
* container: remove unused codebptato2024-05-121-5/+0
|
* client, pager: remove unnecessary std/streamsbptato2024-05-112-12/+7
|
* buffer: fix multipart formsbptato2024-05-113-23/+46
| | | | | | | | | * fix enctype not getting picked up * fix form data constructor requiring open() syscall (which gets blocked by our seccomp filter) * add closing boundary to multipart end * pass fds instead of path names through WebFile/Blob and send those through bufwriter/bufreader
* pager: take $EDITOR from envbptato2024-05-111-5/+5
| | | | | | * use EDITOR environment variable in default config, fix line number ordering in fallback * autodetect vi-like editors and add line number
* term: optimize canvas redraw, remove emulate-overlinebptato2024-05-101-63/+38
| | | | | | | * Replaced the `pcanvas' comparison with a much simpler tracking of the first damaged cell in writeGrid, which is significantly faster. * Removed emulate-overline: it's of too little utility compared to the maintenance burden it caused.
* luwrap: use separate context (+ various cleanups)bptato2024-05-103-64/+55
| | | | | | Use a LUContext to only load required CharRanges once per pager. Also, add kana & hangul vi word break categories for convenience.
* luwrap: replace Nim unicode maps with libunicodebptato2024-05-092-2/+5
| | | | | | | | | | | | | | | | | Instead of using the built-in (and outdated, and buggy) tables, we now use libunicode from QJS. This shaves some bytes off the executable, though far less than I had imagined it would. Also, a surprising effect of this change: because libunicode's tables aren't glitched out, kanji properly gets classified as alpha. I found this greatly annoying because `w' in Japanese text would now jump through whole sentences. As a band-aid solution I added an extra Han category, but I wish we had a more robust solution that could differentiate between *all* scripts. TODO: I suspect that separately loading the tables for every rune in breaksViWordCat is rather inefficient. Using some context object (at least per operation) would probably be beneficial.
* js: refactorbptato2024-05-084-10/+15
| | | | | | | * prefix to-be-separated modules with js * remove dynstreams dependency * untangle from EmptyPromise * move typeptr into tojs
* js: fix compilation on 1.6.14bptato2024-05-061-1/+1
| | | | | | | | | * resolve empty promises without params, not a single undefined param (we can't just unsafeAddr constants on 1.6.14, and I don't see why we need to pass undefined?) * same in client with InternalError * explicitly convert static `asglobal' to bool (1.6.14 turns unquoted enums into ints...)