about summary refs log tree commit diff stats
path: root/src/local/term.nim
Commit message (Collapse)AuthorAgeFilesLines
* winattrs: un-snakeifybptato2024-08-231-4/+4
|
* term: don't panic if termcap tgetent failsbptato2024-08-171-76/+89
| | | | | | | | If TERM is unrecognized by termcap, retry as dosansi. When that fails, just fall back to the non-termcap code path. (There is no reason to panic without termcap; it's just one of the several capability detection mechanisms we use.)
* cssvalues, color: use parseEnumNoCase morebptato2024-08-031-2/+4
|
* term: constify queriesbptato2024-07-301-3/+15
| | | | | + also send register & image dimension queries in forced sixel mode, and image dimension query on window resize
* Fixes for Nim 2.2bptato2024-07-291-1/+1
| | | | | | | | | * 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 + misc fixesbptato2024-07-281-6/+6
| | | | | | | | | * 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
* 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
* 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)
* 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-021-15/+23
| | | | | | | | | | | 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.
* 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-291-11/+17
| | | | | | | | | | | 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.
* term: fix negative line damage bugbptato2024-06-231-4/+2
|
* pager: refactor drawing codebptato2024-06-221-20/+54
| | | | | | | * 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-211-57/+133
| | | | | | * basic repaint algorithm for sixel (instead of brute force "clear the whole screen") * do not re-send kitty images already on the screen
* 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-201-4/+2
| | | | | | | | | | | | | | | * 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.
* Update Chame, Chagashibptato2024-06-131-1/+1
|
* 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.
* term: fix incorrect dimensions used in sixelbptato2024-04-291-30/+29
|
* term: add sixel background color blendingbptato2024-04-291-9/+19
| | | | | | | | | | | | | * blend bgcolor with cell color * do not round up to 6 We don't use the sixel transparency feature because it's useless: sixel transparency (AFAICT) only lets us respect alpha == 0, but we should either respect *all* alpha, or no alpha at all. Since we do color blending, we *do* respect all alpha, but only of background color. This sadly means that text under images gets destroyed, but at least transparent images don't look like garbage.
* term: remove background color blending in sixelbptato2024-04-271-9/+1
|
* ua.css: style xmp like prebptato2024-04-271-1/+9
|
* term: query sixel color register numberbptato2024-04-271-32/+51
|
* Remove unnecessary unsigned castsbptato2024-04-261-2/+2
| | | | | Unsigned operations and conversions to unsigned types always wrap/narrow without checks, so no need to manually mask/cast/etc. them.
* term: add sixel encoderbptato2024-04-251-84/+179
|
* Initial image supportbptato2024-04-251-12/+85
| | | | | | | | | | | | | | | | | * png: add missing filters, various decoder fixes * term: fix kitty response interpretation, add support for kitty image detection * buffer, pager: initial image display support Emphasis on "initial"; it only "works" with kitty output and PNG input. Also, it's excruciatingly slow, and repaints images way too often. Left undocumented intentionally it for now, until it actually becomes useful. In the meantime, adventurous users can find out themselves why: [[siteconf]] url = "https://.*" images = true
* Update code stylebptato2024-04-171-27/+28
| | | | | | * separate params with ; (semicolon) instead of , (colon) * reduce screaming snake case use * wrap long lines
* term: save/restore title after "set title"bptato2024-04-161-2/+12
| | | | | | | | | It is quite straightforward, because XTerm has a functionality to do just this. (In fact, it automatically restores the title when I use smcup/rmcup. But when I don't, it will linger until I close the window or change the title again.)
* term: do not eat last DA1 valuebptato2024-04-101-3/+9
|
* term: flush stdout in anyKeybptato2024-03-291-0/+1
|
* term: improve color detectionbptato2024-03-271-5/+16
| | | | | some terminals (alacritty) don't support XTGETTCAP and don't even respond with ANSI color support to DA1, so just fall back to termcap.
* config, toml: rename enumsbptato2024-03-261-13/+13
|
* term: use termcap for italic resetbptato2024-03-211-3/+7
|
* cell: update FormatFlag naming, remove useless templatesbptato2024-03-211-15/+15
|
* client: refactor inputbptato2024-03-181-41/+113
| | | | | * move mouse handling to term * do not use File for input just to disable buffering anyway
* client, pager: various file saving fixesbptato2024-03-161-2/+2
| | | | | | * do not immediately quit when all containers are gone * fix double saving bug * fix wrong "save to" string
* Move around some modulesbptato2024-03-141-0/+899
* extern -> gone, runproc absorbed by pager, others moved into io/ * display -> local/ (where else would we display?) * xhr -> html/ * move out WindowAttributes from term, so we don't depend on local from server