about summary refs log tree commit diff stats
path: root/src/local
Commit message (Collapse)AuthorAgeFilesLines
* buffer: make video, audio clickablebptato2024-12-302-5/+13
| | | | | more intuitive than shoehorning it into "view image" (also makes it easier to apply the content type)
* pager: misc improvementsbptato2024-12-301-44/+44
| | | | ok I'll use result, whatever
* cookie: add persistent cookies, misc refactoring/fixesbptato2024-12-292-23/+39
| | | | | | | | | | | | | Mostly compatible with other browsers/tools that follow the Netscape/curl format. Cookie jars are represented by prepending "jar@" to the host part, but *only* if the target jar is different than the domain. Hopefully, other software at least does not choke on this convention. (At least curl seems to simply ignore the entries.) Also, I've moved cookies.nim to config so that code for local files parsed at startup remains in one place.
* pager: small cleanupbptato2024-12-291-2/+1
|
* history: remove comment parsing, fix fd leakbptato2024-12-291-0/+2
|
* env: do not copy attrs, fix screen on clientbptato2024-12-281-1/+4
| | | | Now screen.width etc. works in the pager too.
* cookie: remove broken third-party-cookie optionbptato2024-12-271-2/+1
| | | | | | | | | Looking at it closer, this never actually did what it advertised to do. It only affected first-party cookies from subdomains, but that has been fixed; third-party cookies were never supported in the first place. (In fact, even first-party cookies are still skipped unless directly received on navigation. This should probably be fixed.)
* term: fix in-cell offset bug on kitty image scrollbptato2024-12-271-0/+5
| | | | | If the image has an offx or offy, then it means it is partially outside the screen, so its offx2/offy2 is already accounted for.
* term: fix display-charset not being interpretedbptato2024-12-261-5/+5
| | | | Also fixes the -O option.
* Optimize some Option[string] outbptato2024-12-261-4/+5
| | | | toJS is generally more efficient
* env: reflect user agent header in userAgentbptato2024-12-261-0/+1
|
* Misc character display fixesbptato2024-12-225-21/+11
| | | | | | | | | | | | | | | | | | * fix luwrap comparison function * strip high unicode controls in term/pager * use wcwidth in dirlist2html * remove combining category from strwidth * remove unused "disallowed" field from lineedit My initial goal with switching to wcwidth in dirlist2html was just to get rid of the outdated combining map in charwidth_gen. Then I realized that layout will normalize those out anyway, so we don't actually have to deal with them anywhere. Also, I found a few bugs in the process; high unicode control chars not being stripped out was a particularly bad one, as it allows for pages to mess up the terminal output. (Easiest way to replicate: just open a random binary file without this patch.)
* Add historybptato2024-12-173-43/+73
| | | | | It's still missing a "color visited links" feature, but it's better than nothing.
* buffer: only set new buffer's target on clonebptato2024-12-202-6/+8
|
* response: automatically resume before closebptato2024-12-191-3/+0
| | | | doing it manually is too error prone
* pager: fix short error messages not being printedbptato2024-12-191-1/+1
|
* pager: fix crash on gotoURL with save + mailcapbptato2024-12-191-1/+2
| | | | this broke saveImage
* pager: do not crash browser when deleting a crashed bufferbptato2024-12-181-1/+5
|
* pager, select: hide menu if right click ends outsidebptato2024-12-182-45/+60
| | | | | | | | Inspired by Dillo. (Just the movement mechanism; Dillo doesn't hide the context menu on double click, but we still do.) Also, we now disable highlighting of menu items when the mouse is hovering outside.
* cookie: small bugfix, misc refactoringbptato2024-12-171-9/+2
| | | | | Always override Expires with Max-Age, but never the other way (as per spec.)
* default(T) -> T.default, add some strict defsbptato2024-12-171-2/+2
|
* pager: try to always display the error messagebptato2024-12-171-1/+11
| | | | | Whether this works or not still depends on many variables, but it should be enough in most cases.
* select: fix height definitionbptato2024-12-151-13/+10
| | | | | now I sort of understand how it works. basically maxh and maxw represent the inner area occupied by the widget at any time.
* chabookmark fixes & improvementsbptato2024-12-151-1/+4
| | | | | | | | * correct action on M-b * add external.bookmark option * move openFileExpand functionality into unquote * add menu items * update docs
* client: document readFile, writeFile; add getenv, setenvbptato2024-12-141-7/+32
| | | | | | | | Both are quite useful. readFile and writeFile got a small makeover in error handling; in particular, readFile now returns null instead of the empty string when the file is missing and writeFile throws a TypeError on I/O errors.
* term: allow ANSI fgcolor + bgcolorbptato2024-12-131-6/+2
| | | | | | | | Not quite sure why I had assumed that this is broken. At least on XTerm, the previous behavior definitely was, e.g. with a white-ish background and white foreground it would end up correcting the contrast to purple even with black CSS color (thus breaking the "no fgcolor with bgcolor" assumption anyway.)
* container, cookie: simplify extractCookies, cookieJar.addbptato2024-12-131-4/+3
|
* cookie: remove JS modulebptato2024-12-131-2/+0
| | | | I no longer need it
* pager: fix casingbptato2024-12-121-1/+1
|
* pager: do not prompt for text typesbptato2024-12-111-1/+7
| | | | we hadn't before, and it's annoying when using cha as a pager
* pager, mailcap: misc fixes, add prompt for global mailcapbptato2024-12-111-94/+218
| | | | | | | | | | | | | | | | | | | | | | | | In the past, Chawan would read global mailcap (/etc/mailcap, ...) too, but every now and then that would run entries that I didn't even know existed and definitely didn't intend to run. So I changed it to only use ~/.mailcap, but this meant users now had to add mailcap entries for every single mime type. At some point I also changed application/octet-stream to always save to disk, which is usually nice except when a text file is misrecognized as binary. Often times I just want to decide myself what to do. So now there are two layers. First, the global mailcap files (path as per RFC) prompt before executing. Then there is ~/.chawan/auto.mailcap (or ~/.config/chawan/auto.mailcap) which runs entries automatically. If you press shift before selecting an option in the prompt, the corresponding entry gets copied to auto.mailcap. It's also possible to type a new entry on the fly. Overall I think it's quite convenient. One unfortunate side effect is that existing users will have to migrate their entries to auto.mailcap, or redefine external.auto-mailcap to e.g. ~/.mailcap, but this seems acceptable.
* pager: remove unused variablebptato2024-12-101-15/+3
|
* pager: fix nil derefbptato2024-12-101-2/+2
| | | | | | isearch feels quite janky in general, and I think there's still a race lurking here... for now it's ok, but like buffer display, this really belongs in a state machine (not promises)
* client: mostly merge into pagerbptato2024-12-092-808/+784
| | | | | | | | not completely, because that would break the existing API :/ this also fixes the broken interruptHandler - it no longer crashes, but it's still inefficient... probably it should "just" handle SIGINT instead
* container: de-extern some procsbptato2024-12-091-19/+19
|
* pager: hide kitty images when menu is openbptato2024-12-062-3/+20
| | | | | | | | | | | | | | | | So I thought this was just a simple z-ordering issue, but silly me, it's never simple with images. In this case it turns out Kitty can't really do z-ordering with text the way Sixel can - in short, you must pick if the image is below text, or above text, but never both. I imagine you could also get something to work with z=-1 and stretched 1-pixel colored images or some similarly horrifying hack. It seems very annoying to code and maintain, so I won't. (In some way this is impressive, because Sixel z-ordering sucks too. Somehow we got into a situation where both viable image display protocols are incapable of expressing some useful ways of image layering, of course in a mutually incompatible way.)
* config, mailcap: remove std/streams dependency, specialize mmapbptato2024-12-051-1/+1
| | | | | | | | | | * use PosixStream/mmap for mailcap reading too; this finally lets us get rid of std/streams in the entire codebase * split up recvDataLoopOrMmap into 3 functions: one that can fall back to recvAll, one that falls back to recvDataLoop, and one that does not fall back to anything * use MAP_PRIVATE in mmap for read (we don't care if changes are propagated, as we do no changes to cached files)
* mimetypes: refactor, use mime.types for inline image extensionsbptato2024-12-052-2/+3
| | | | | | | | | | | | * remove std/streams use from mime.types; mmap and parse directly * use mime.types for inline image extensions * add some jpeg file extensions Latter came up because I was trying to add a format locally and it wouldn't recognize it on images from my file system (i.e. by extension). As a security measure we still do not allow additional extensions for predefined inline image types.
* pager, term: use cell offset with kitty imagesbptato2024-12-032-11/+24
| | | | | | | | Gets rid of rounding errors when positioning images. Theoretically this is possible with Sixel too, but as always, it's ten times as difficult to implement as with Kitty, so I'll leave it for later.
* term: respect LINES, COLUMNS; do not crash without vi/vebptato2024-12-011-6/+12
|
* term: disable screen workaround on tmuxbptato2024-12-011-1/+2
|
* pager: do not make pointless requests in viewImage, add saveImagebptato2024-11-302-5/+10
| | | | | | | with buffer.images enabled, we already cache them, so we can skip the additional request also, add saveImage, bound to sI
* twtstr: add mypairsbptato2024-11-282-3/+3
| | | | | This couldn't get into system.nim for technical reasons, but it's still pretty useful when iterating over non-mutable openArrays.
* layout, term, url: misc cleanupbptato2024-11-281-1/+0
|
* mailcap: add x-needsstyle extension fieldbptato2024-11-271-2/+7
| | | | | | | Useful when an x-htmloutput handler needs styling for the HTML output to be formatted correctly (as a sort of pseudo-ua style sheet). ref. https://todo.sr.ht/~bptato/chawan/28
* select: pad options in newSelectbptato2024-11-262-18/+19
| | | | this way it works for <select> tags too
* client: exit if quit was called inside a jobbptato2024-11-251-10/+11
| | | | ref. https://todo.sr.ht/~bptato/chawan/27
* pager, select: add more items, misc fixesbptato2024-11-253-46/+78
| | | | | | eh probably have to move the event loop to pager...
* select: misc fixesbptato2024-11-241-2/+10
| | | | | * jump to first selected item (if any) when opened * fix crash on control chars in option (at least they didn't bleed...)
* loader/* -> serverbptato2024-11-243-14/+14
| | | | one less mystery