about summary refs log tree commit diff stats
path: root/src/local
Commit message (Collapse)AuthorAgeFilesLines
* buffer, pager, config: add meta-refresh + misc fixesbptato2024-07-284-32/+91
| | | | | | | | | * 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
* client, sandbox: fix termux buildbptato2024-07-241-5/+8
| | | | | Still not perfect, because it crashes on missing /tmp dir so you have to manually set it...
* pager: fix dead containers left in replaceBackupbptato2024-07-232-0/+9
| | | | | | | | | | | 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
* term: fix positionImage sixel size clamping (take 2)bptato2024-07-231-2/+2
| | | | | | Hope I got it right this time. (The previous iteration did not take into account the image position on the screen, so it was just as bad as the first one.)
* term: fix positionImage sixel size clampingbptato2024-07-231-6/+10
| | | | | clamping maxwpx/maxhpx crops the image starting from the canvas corner, not the image corner
* term: fix kitty image positioningbptato2024-07-201-2/+5
| | | | only use sixelMaxWidth/sixelMaxHeight for sixel
* loader: copy cached items on buffer cloningbptato2024-07-203-4/+8
| | | | | This fixes a bug where cloning buffers with images would crash the browser.
* loader: async status/headers for fetchbptato2024-07-191-7/+2
| | | | | | | | 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.)
* 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
|