about summary refs log tree commit diff stats
path: root/res
Commit message (Collapse)AuthorAgeFilesLines
* pager: send Accept: */* for viewImagebptato2024-06-081-1/+8
|
* pager, buffer: improve forms, protocol configbptato2024-06-081-0/+9
| | | | | | * refactor form submission * add options to specify form handling per protocol * block cross-protocol POST requests
* config.toml: update headersbptato2024-06-081-2/+2
| | | | | | | | | * prepend Mozilla/5.0 to User-Agent; an unfortunate fact is that even the G-lettered search engine breaks without it, and I've seen sites that refuse to serve pages at all. * Add */* to Accept, in the hope that we'll get images more often. (The ideal solution is to set it to "*/*" when fetching images, but the API format doesn't let us do this yet; TODO.)
* pager: rework D/discard bufferbptato2024-05-312-1/+8
| | | | | | | | | | | | | | | | | | | | | 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'.)
* about: markdownify & update license.htmlbptato2024-05-281-41/+36
| | | | We have a markdown converter, so why not use it?
* Update docsbptato2024-05-161-2/+2
|
* config: separate tmp dir for sockets, usersbptato2024-05-161-1/+2
| | | | | | | * 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-1/+1
|
* Fix typobptato2024-05-111-1/+2
|
* pager: take $EDITOR from envbptato2024-05-111-1/+1
| | | | | | * 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-1/+0
| | | | | | | * 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.
* js: fix various leaks etc.bptato2024-05-032-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously we didn't actually free the main JS runtime, probably because you can't do this without first waiting for JS to unwind the stack. (This has the unfortunate effect that code now *can* run after quit(). TODO: find a fix for this.) This isn't a huge problem per se, we only have one of these and the OS can clean it up. However, it also disabled the JS_FreeRuntime leak check, which resulted in sieve-like behavior (manual refcounting is a pain). So now we choose the other tradeoff: quit no longer runs exitnow, but it waits for the event loop to run to the end and only then exits the browser. Then, before exit we free the JS context & runtime, and also all JS values allocated by config. Fixes: * fix `ad' flag not being set for just one siteconf/omnirule * fix various leaks (since leak check is enabled now) * use ptr UncheckedArray[JSValue] for QJS bindings that take an array * allow JSAtom in jsgetprop etc., also disallow int types other than uint32 * do not set a destructor for globals
* css, dom: simplify ident parsing, canvas fixesbptato2024-05-011-1/+1
| | | | | | | | * add CSSStyleDeclaration setter * move ident maps directly into enums * more complete CSSComputedValue stringifier * turn canvas into a pseudo-image in cascade * set canvas to inline-block
* ua.css: style xmp like prebptato2024-04-271-1/+1
|
* config: fix copy image URL, document copy commandsbptato2024-04-271-1/+1
|
* buffer: add toggleImagesbptato2024-04-271-0/+2
|
* Initial image supportbptato2024-04-251-0/+1
| | | | | | | | | | | | | | | | | * 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
* ua.css: use padding for lists, not marginbptato2024-04-031-1/+1
| | | | | FF does it this way as well, and it seems sr.ht depends on it being padding instead of margin.
* pager: edit source fixesbptato2024-03-301-1/+1
| | | | | | | * URI-decode path name for local files in default config * (ab)use mailcap command quoting for passing params to editor command instead of replicating it badly in formatEditorName * rename mailcap enums
* ansi2html: support passing titlesbptato2024-03-291-1/+1
| | | | | | | Use content type attributes so e.g. git.cgi can set the title even with a text/x-ansi content type. (This commit also fixes some bugs in content type attribute handling.)
* config: improve input systembptato2024-03-262-215/+344
| | | | as described in <https://todo.sr.ht/~bptato/chawan/6>
* ansi2html: add separate switch for "standalone"bptato2024-03-211-1/+1
| | | | | this way its output can be embedded into documents without a pointless DT declaration
* pager: add "save link", "save source"; change & document some keybindingsbptato2024-03-202-9/+18
| | | | | | | | | * `s{Enter}' now saves link, and `sS' saves source. * Changed ;, +, @ to g0, g$, gc so that it's somewhat consistent with vim (and won't conflict with ; for "repeat jump to char") * Changed (, ) to -, + so that it doesn't conflict with vi's "previous/next sentence" (once we have it...) * Add previously missing keybindings to about:chawan
* config: remove system mailcaps from default mailcap pathbptato2024-03-191-4/+1
| | | | | | | | I haven't seen a single OS-shipped mailcap file yet that would be suitable for use with Chawan. The one on Debian wants to open every text file with vim; the one in FreeBSD ports is straight up broken. mime.types works much better and thus stays.
* main: set CHA_LIBEXEC_DIR env var at startupbptato2024-03-191-0/+6
| | | | This way, we can use it everywhere (e.g. in mailcap).
* urimethodmap: do not set query string for gmifetchbptato2024-03-191-1/+1
| | | | we use MAPPED_URI_* now
* buffer: add markURLbptato2024-03-192-0/+2
| | | | Useful when browsing plaintext files; w3m has it too.
* urimethodmap: fix sftp, ftpsbptato2024-03-191-2/+2
| | | | they all use the same CGI script (with varying success)
* pager, loader: add "Save file to" functionalitybptato2024-03-161-1/+2
| | | | | | | As simple as it could be; no download panel yet. Also, remove the xdg-open default mailcap entry; it's better to just save by default.
* config: add start.console-buffer optionbptato2024-03-161-0/+1
| | | | useful for debugging
* config.toml: fix sE bindingbptato2024-03-151-1/+1
|
* pager: add "open in editor" keybinding (sE)bptato2024-03-142-0/+9
| | | | | | only for source for now, rendered document is a bit more complicated (also, get rid of useless extern/editor module)
* man: misc improvementsbptato2024-03-141-3/+3
| | | | | | | * do not use query string for arguments * accept symlinks as man binaries * improve error message reporting * run all regexes on the original line
* rudimentary support for <video>, <audio>bptato2024-03-131-1/+1
| | | | | we just treat them as img tags. lazy, but works suprisingly well -- so long as the server sends us a Content-Type, anyway.
* man: rewrite in Nimbptato2024-03-131-18/+0
| | | | | | | | | | | | Depending on Perl just for this is silly. Now we use libregexp for filtering basically the same things as w3mman2html did. This required another patch to QuickJS to avoid pulling in the entire JS engine, but in return, we can now run regexes without a dummy JS context global variable. Also, man.nim now tries to find a man command on the system even if it's not in /usr/bin/man.
* strwidth, renderdocument: small refactoringbptato2024-03-032-132/+449
| | | | | | * put attrs pointer in state * simplify width() * use unsigned int as ptint to avoid UB
* css: remove caption-side: left, right, fix caption-side: bottombptato2024-03-011-8/+0
| | | | | | | | left/right never really worked correctly, is non-standard, and the only browser that supported it (Firefox) removed it years ago. bottom was adding the table width to its offset instead of the height, that is now fixed.
* Add mouse supportbptato2024-02-291-0/+1
|
* pager: improve URL loading procsbptato2024-02-281-3/+3
| | | | | | | Split up load into loadSubmit, gotoURL: loadSubmit is a replacement for load(s + '\n'), and gotoURL is a load that does no URL expansion. Also, fix a bug where load("\n") would crash the browser.
* config: add yI for yanking image URLsbptato2024-02-272-2/+14
|
* buffer: add image viewer supportbptato2024-02-272-0/+3
|
* misc refactoringsbptato2024-02-272-23/+0
| | | | | | * rename buffer enums * fix isAscii for char 0x80 * remove dead code from URL
* term: improve pixels-per-column/line detectionbptato2024-02-251-0/+8
| | | | | | | | | Some terminal emulators (AKA vte) refuse to set ws_xpixel and ws_ypixel in the TIOCGWINSZ ioctl, so we now query for CSI 14 t as well. (Also CSI 18 t for good measure, just in case we can't ioctl for some reason.) Also added some fallback (optionally forced) config values for width, height, ppc, and ppl. (This is especially useful in dump mode.)
* ua.css: fix details element displaybptato2024-02-251-3/+3
| | | | no open/closed logic yet, but at least this fixes the display: property
* ua.css: use ANSI yellow for linksbptato2024-02-251-1/+1
| | | | | | | | | This was my original intention, but there wasn't a way to do it until now. The difference is that this respects user-configured color values. (Now that I think of it, it may be better to automatically detect prefers-color-scheme based on the default background color, and then use blue for bright backgrounds and yellow for dark backgrounds. Hmm.)
* Separate ANSI text decoding from main binarybptato2024-02-252-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Handling text/plain as ANSI colored text was problematic for two reasons: * You couldn't actually look at the real source of HTML pages or text files that used ANSI colors in the source. In general, I only want ANSI colors when piping something into my pager, not when viewing any random file. * More importantly, it introduced a separate rendering mode for plaintext documents, which resulted in the problem that only some buffers had DOMs. This made it impossible to add functionality that would operate on the buffer's DOM, to e.g. implement w3m's MARK_URL. Also, it locked us into the horribly inefficient line-based rendering model of entire documents. Now we solve the problem in two separate parts: * text/x-ansi is used automatically for documents received through stdin. A text/x-ansi handler ansi2html converts ANSI formatting to HTML. text/x-ansi is also used for .ans, .asc file extensions. * text/plain is a separate input mode in buffer, which places all text in a single <plaintext> tag. Crucially, this does not invoke the HTML parser; that would eat NUL characters, which we should avoid. One blind spot still remains: copiousoutput used to display ANSI colors, and now it doesn't. To solve this, users can put the x-ansioutput extension field to their mailcap entries, which behaves like x-htmloutput except it first pipes the output into ansi2html.
* config: replace default-flags with ignore-casebptato2024-02-221-0/+1
| | | | | | default-flags was overly complicated for its purpose. Also, ignore-case is quite useful, so enable it by default.
* Replace Chakasu with Chagashibptato2024-02-221-1/+0
| | | | | | The API is horrid :( but at least it copies less. TODO: think of a better API.
* term: fix coloring messbptato2024-02-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Until now, the config file required manual adjustment for the output to look bearable on terminals colored differently than {bgcolor: black, fgcolor: white}. Also, it only detected RGB when COLORTERM was set, but this is not done by most (any?) terminal emulators (sad). To improve upon the situation, we now query the terminal for some attributes on startup: * OSC(10/11, ?) -> get the terminal's bg/fgcolor * DCS(+, q, 524742) -> XTGETTCAP for the "RGB" capability (only supported by a few terminals, but better than nothing) * Primary device attributes -> check if ANSI colors are supported, also make sure we don't block indefinitely even if the previous queries fail If primary device attributes does not return anything, we hang until the user types something, then notify the user that something went wrong, and tell them how to fix it. Seems like an OK fallback. (The DA1 idea comes from notcurses; since this is implemented by pretty much every terminal emulator, we don't have to rely on slow timing hacks to skip non-supported queries.)
* ua.css: remove inline-block from tt, var, font, u, s, strikebptato2024-02-171-1/+1
| | | | It's inconsistent with other browsers' default stylesheets.