about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
...
* pager: do not ask to download text/*bptato2024-03-191-1/+1
| | | | it's text, so we can display it anyway.
* config: remove system mailcaps from default mailcap pathbptato2024-03-192-8/+15
| | | | | | | | 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-195-26/+22
| | | | This way, we can use it everywhere (e.g. in mailcap).
* bonus: add git.cgibptato2024-03-191-0/+64
| | | | just for clickable git log hashes
* cgi: set cwd to CGI dirbptato2024-03-191-3/+7
| | | | | for w3m and real CGI compatibility; also, it makes more sense than using whatever directory the user happened to be in when starting the browser
* urimethodmap: do not set query string for gmifetchbptato2024-03-191-1/+1
| | | | we use MAPPED_URI_* now
* buffer: add markURLbptato2024-03-198-10/+70
| | | | 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)
* man: improve processBackspace underscore handlingbptato2024-03-191-2/+6
| | | | | | it is best to base our interpretation of ^H_ on the current formatting, because a) it works predictably well on man output and b) a formatting mismatch results in manRe malfunctioning
* stylednode: clean up code stylebptato2024-03-181-30/+39
|
* client: refactor inputbptato2024-03-185-167/+159
| | | | | * move mouse handling to term * do not use File for input just to disable buffering anyway
* config: parse mime.types/mailcap/urimethodmap inside parseConfigbptato2024-03-185-104/+76
| | | | | | Better (and simpler) than storing them all over the place. extra: change lmDownload text to match w3m
* pager: remove useless codebptato2024-03-182-16/+1
|
* config: clean up/simplifybptato2024-03-1710-330/+349
| | | | | | | | | * Parse the default config at runtime. There's no significant performance difference, but this makes it much less painful to write config code. * Add better error reporting * Make fromJS2 easier to use * Unquote ChaPaths while parsing config
* Move SIGCHLD ignore call to forkserverbptato2024-03-172-4/+1
| | | | seems like it confuses popen()
* forkserver: set process titles for processesbptato2024-03-172-0/+42
| | | | | this is unfortunately truncated on Linux, but I don't care enough to hack around this
* main: ignore SIGCHLDbptato2024-03-171-0/+4
| | | | to avoid zombies
* man: better error handlingbptato2024-03-171-35/+89
| | | | | | The "redirect stderr to stdout" scheme broke with groff/man-db, as it was spitting out warnings during execution. So now we handle stderr and stdout separately.
* client: fix "Hit any key" bug on load failurebptato2024-03-173-21/+45
| | | | it's an unintended side effect that we do not want
* pager: fix buffer filteringbptato2024-03-171-2/+4
|
* io: add BuferedWriterbptato2024-03-168-207/+310
| | | | | | | | | | Unsurprisingly enough, calling `write` a million times is never going to be very fast. BufferedWriter basically does the same thing as serialize.swrite did, but queues up writes in batches before sending them. TODO: give sread a similar treatment
* client, pager: various file saving fixesbptato2024-03-163-18/+22
| | | | | | * do not immediately quit when all containers are gone * fix double saving bug * fix wrong "save to" string
* pager: fix disappearing buffers when reload failsbptato2024-03-161-9/+8
| | | | | we do have logic for this in replace(), but it was not working because setContainer changed the buffer too early.
* container: fall back to text/plain instead of application/octet-streambptato2024-03-162-3/+5
| | | | | | | | | | | | | This has its own problems, but application/octet-stream has the horrible consequence that opening any local file with an unrecognized type automatically quits the browser. (FWIW, w3m also falls back to text/plain, so it's not such an unreasonable default.) The proper solution would be to a) fix the bug that makes the browser auto-quit and b) show a "what to do" prompt for unrecognized file types (and allow users to override it, preferably on a per-protocol basis.)
* Update docsbptato2024-03-161-3/+0
|
* pager: simplify line editingbptato2024-03-162-64/+69
| | | | | * embed prompt string into enums * move pager.username to LineDataAuth
* pager, loader: add "Save file to" functionalitybptato2024-03-165-39/+138
| | | | | | | 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.
* layout: table column size fixesbptato2024-03-161-33/+20
| | | | | | | * remove unnecessarily duplicated code (probably a copy-paste error) * apply UNIT_PERC computed widths for table cells too (just base it on sizes the table receives) * remove unnecessary parameters in some procs
* loader: add missing flush() callsbptato2024-03-161-1/+4
| | | | | | | Seems wise to flush before e.g. reading. And unwise to enable buffering on tee() even though we disable it on startRequest()
* trans.cgi: set content type to text/x-ansibptato2024-03-161-2/+2
|
* cgi: fix libexec dir not being setbptato2024-03-161-3/+4
|
* config: add start.console-buffer optionbptato2024-03-165-3/+16
| | | | useful for debugging
* data: content type fixesbptato2024-03-151-7/+5
| | | | | | | * do not skip first 5 chars (this is legacy from when we used query strings) * allow practically anything but control chars (so we can use parameters)
* man: improve header/footer conversionbptato2024-03-151-4/+11
| | | | | | | * run processBackspace on the first line, because groff likes to print formatting there too * check man references like SAMEPAGE(1) with isCommand because it's commonly found in footers
* man: work around parameter insanitybptato2024-03-152-9/+32
| | | | | | | | | | | | | | | | | | | | | This is horrible. -s means completely different things on various systems. -l does not exist on various systems. Nothing is standardized, except that man should take at least one parameter and that -k should perform a search. (Seriously, that's all.) So what we do is: * add a separate env var for overriding apropos * for man:, never use -s to specify sections * for man-k:, fall back to man, EXCEPT on FreeBSD which does not have a working section specifier on man -k (neither -S nor MANSECT does anything) * for man-l:, just pass the path wholesale to man and hope it does something useful. Also, we now set MANCOLOR to 1 so FreeBSD man gives us formatting as well.
* config.toml: fix sE bindingbptato2024-03-151-1/+1
|
* container: cursor x fixesbptato2024-03-151-2/+4
| | | | | | * also set fromX to corrected target x if target x is less than corrected x; this is mainly so that setCursorX(-1) works as expected * return w from cursorFirstX() even if cursorx is <= the last character
* Clean up BufferConfigbptato2024-03-156-81/+73
| | | | | | | | It was defined in the wrong module, and unnecessarily included LoaderClientConfig. Also, referrerPolicy was not being propagated to loader clients because it was (incorrectly) in BufferConfig instead of LoaderClientConfig.
* version: print error message on a single linebptato2024-03-141-4/+3
| | | | it's easier to see that it's a single message this way
* client: check if container was found before deleting itbptato2024-03-141-2/+2
| | | | | | Containers may also be deleted without a connection. More specifically: by mailcap, when it launches an external process without opening the output in a buffer.
* pager: unregister containers properly when headers are pendingbptato2024-03-143-14/+33
| | | | | It can happen that a container is deleted before it acquires a buffer process; add it to the `unreg' array in this case too.
* loader: handle connections where pid/key does not matchbptato2024-03-141-1/+8
| | | | | This can easily happen if a buffer process is killed and/or a new process takes its ID.
* cgi: fix broken pipe handlingbptato2024-03-141-1/+8
| | | | | if the socket is closed before the loader could send all header data, we must destroy the parser to avoid sending a result twice.
* Move around some modulesbptato2024-03-1421-96/+88
| | | | | | | | * 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
* pager: add "open in editor" keybinding (sE)bptato2024-03-149-77/+103
| | | | | | only for source for now, rendered document is a bit more complicated (also, get rid of useless extern/editor module)
* loader: only trap SIGTERMbptato2024-03-141-1/+1
| | | | SIGINT is trapped (well, ignored) by forkserver already.
* man: misc improvementsbptato2024-03-142-62/+74
| | | | | | | * do not use query string for arguments * accept symlinks as man binaries * improve error message reporting * run all regexes on the original line
* loader: fix crash on malformed CGI headersbptato2024-03-142-3/+2
| | | | | Setting istream to nil was preventing finishCycle from unregistering & closing it.
* twtstr: fix deleteChars, do not remove space in replaceControlsbptato2024-03-142-11/+7
|
* doc: revert capitalization changebptato2024-03-141-1/+1
| | | | it looks weird