about summary refs log tree commit diff stats
path: root/res
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* res/mime.types: add gmi extensionbptato2024-02-141-0/+1
|
* css: hide noscript tags when scripting is enabledbptato2024-02-131-0/+6
|
* config: use `yu` for copying URLsbptato2024-02-132-2/+3
| | | | | | | | | | | It's my mistake; it should have been this way all along. `u` is peek URL, so `yu` should copy the same URL. And of course `c` displays a different URL than what is being copied. Ouch. I would make `yc` copy the current page's URL too (instead of M-y...), but that would make things way too confusing. Maybe sometime in the future, when I unlearn `yc`.
* config.toml: C-c cancels setMark/gotoMark operationsbptato2024-02-121-3/+21
|
* widthconv: bugfixesbptato2024-02-111-1/+3
| | | | | | | * fix failed assertion on non-ha-column half-width chars followed by handakuten with text-transform: full-width * fix dquot full-width conversion * fix lone half-width han/dakuten conversion
* twtstr: misc refactoringsbptato2024-02-092-100/+93
| | | | | | * move out half width <-> full width converters * snake_case -> camelCase * improve toScreamingSnakeCase slicing
* about:license: fix typobptato2024-02-011-1/+1
|
* Add default md2html converterbptato2024-01-301-0/+1
|
* Add command to yank link under cursor (yc)bptato2024-01-292-1/+14
|
* Add mancha man page viewerbptato2024-01-262-1/+24
| | | | | | | | | | derived from w3mman2html.cgi, there are only a few minor differences: * different man page opener command * use man:, man-k:, man-l: instead of query string to specify action * no form input (C-lC-uman:pageC-m is faster anyway) TODO rewrite in Nim so we don't have to depend on Perl...
* charwidth: use ptint in controls calculationbptato2024-01-192-19/+19
| | | | int was incorrect
* about:chawan: fix some descriptionsbptato2024-01-191-2/+2
|
* Re-design word handling, add e, E, W, B, etc.bptato2024-01-191-2/+6
| | | | | | | | | | | | * Add functions for moving to the beginning/end of words (vi `b', `e'). * As it turns out, there are many possible interpretations of what a word is. Now we have a function for each reasonable interpretation, and the default settings match those of vi (and w3m in w3m.toml). (Exception: it's still broken on line boundaries... TODO) * Remove `bounds` from lineedit, it was horrible API design and mostly useless. In the future, an API similar to what pager now has could be added. * Update docs, and fix some spacing issues with symbols in the tables.
* charwidth: use pre-generated map filebptato2024-01-043-0/+399
| | | | Also for reducing compilation time.
* idna: use pre-generated map file, misc changesbptato2024-01-042-0/+2637
| | | | | | | | | Speeds up compilation somewhat. Included in the repository because it's not that huge. misc changes: * use seq, not set for UCS-16 sets (it takes up less space) * remove unnecessary noSideEffects casts
* Add spartan supportbptato2024-01-031-0/+1
| | | | why not
* ua.css: add plaintextbptato2023-12-201-1/+1
|
* config: allow overriding default prepended schemebptato2023-12-151-1/+2
|
* Various fixesbptato2023-12-131-6/+6
| | | | | | | * Makefile: fix parallel build, add new binaries to install target * twtstr: split out libunicode-related stuff to luwrap * config: quote default gopher2html URL env var for unquote * adapter/: get rid of types/url dependency, use CURL url in all cases
* http: use CURLU for URLsbptato2023-12-131-2/+2
|
* Move http out of main binarybptato2023-12-131-0/+2
| | | | | | | | | | | | Now it is (technically) no longer mandatory to link to libcurl. Also, Chawan is at last completely protocol and network backend agnostic :) * Implement multipart requests in local CGI * Implement simultaneous download of CGI data * Add REQUEST_HEADERS env var with all headers * cssparser: add a missing check in consumeEscape
* Move gopher to adapter/bptato2023-12-121-0/+12
| | | | Also, move default urimethodmap config to res.
* css: add case-insensitive matchingbptato2023-12-111-7/+7
| | | | Also case-sensitive, but for now that is the same as normal matching...
* css: add text-transformbptato2023-12-112-0/+158
| | | | | | | Probably not fully correct, but it's a good start. Includes proprietary extension -cha-half-width, which converts full-width characters to half-width ones.
* Separate gopher conversion from main binarybptato2023-12-101-1/+1
| | | | | | | | | | | | | | | | | | | | | Now we use a (much simplified) gopher2html binary in libexec, instead of converting gopher directories to HTML in loader/gopher. This has two advantages: * Less ugly conversion logic in the loader module; we can just convert the file line by line. (The previous converter also had some correctness issues, that is fixed now as well.) * If the user desires, they can replace the gopher converter with another binary using the mailcap mechanism. The disadvantages are: * For now, source display is broken. This is a problem with all mailcap filters in general, and should be fixed in the future. (That said, the previous version also only displayed the converted HTML source, which was not really useful anyway.) * The proper directory structure is required for this to work; OTOH plenty of work has been done so that this is as frictionless as possible, so it should not really be a problem.
* Enable finger protocol by defaultbptato2023-12-101-1/+1
| | | | | | * Add a default urimethodmap that points finger: to cha-finger * Install cha-finger to /usr/local/libexec/cha/cgi-bin by default * cha-finger: use ALL_PROXY if given, die if curl is not installed
* config: better path handling; fix array parsing bugbptato2023-12-101-0/+1
| | | | | | | | | * Paths are now parsed through an unified code path with some useful additions like environment variable substitution. * Fix a bug in parseConfigValue where strings would be appended to existing arrays (and not override them). * Fix beforeLast calling afterLast for some reason. * Add a default CGI directory.
* config: disable w3m-cgi-compat by defaultbptato2023-12-101-1/+1
| | | | | It was a bad idea to enable by default, as it is mostly pointless and is a potential security hole.