about summary refs log tree commit diff stats
Commit message (Collapse)AuthorAgeFilesLines
...
* http: suppress proxy connect headersbptato2024-03-292-0/+2
| | | | causes problems with header parsing
* fflush() before forksbptato2024-03-283-6/+19
| | | | | seems like a good idea, especially because CGI uses stdout as the IPC mechanism
* http: fix broken early hint handlingbptato2024-03-281-1/+2
| | | | | | | | | | | The empty string comparison here was in fact pointless; in cw-out.c, libcurl only calls cwb (which is curlWriteHeader in this case) if blen is not 0, so the string will never be empty. (Instead, it is expected to be \r\n; I've added \n too since CGI can already parse headers like that.) Normally it still worked because we just passed through the line to cgi.nim. However, it choked horribly on HTTP/2 early hints.
* Add capsicum supportbptato2024-03-2812-38/+171
| | | | | | | | | | | | | It's the sandboxing system of FreeBSD. Quite pleasant to work with. (Just trying to figure out the basics with this one before tackling the abomination that is seccomp.) Indeed, the only non-trivial part was getting newSelector to work with Capsicum. Long story short it doesn't, so we use an ugly pointer cast + assignment. But even that is stdlib's "fault", not Capsicum's. This also gets rid of that ugly SocketPath global.
* 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.
* container: rename enumsbptato2024-03-271-17/+17
|
* buffer: fix cancel()bptato2024-03-274-23/+54
| | | | | | | | | | * fix mismatch between return value & read value that would either crash or freeze the browser depending on its mood * add an assertion to detect the above footgun * fix some resource leaks * fix iteration over a table that called a function which altered the table in buffer's cancel() * if user cancels before anything is loaded, destroy the container too
* layout: fix another infinite loopbptato2024-03-261-2/+2
| | | | | | | aaaaa (this was even worse than the previous one, of course caused by the fix...)
* config: improve input systembptato2024-03-267-313/+554
| | | | as described in <https://todo.sr.ht/~bptato/chawan/6>
* config, toml: rename enumsbptato2024-03-263-114/+114
|
* layout: avoid infinite loop in line wrappingbptato2024-03-261-11/+10
| | | | it would get into an infinite loop with line-height: 0 and floats
* layout: also round line height for painting backgroundsbptato2024-03-261-3/+2
| | | | | it's pointless to do otherwise, and results in inconsistencies between line positioning and background coloring.
* layout: ensure lines are not higher than they must bebptato2024-03-262-11/+17
| | | | | | This is still a more conservative approach than completely disabling line-height. It seems to work better than preserving rounded line-height in all cases, anyway.
* layout: optimize inline background areasbptato2024-03-261-18/+51
| | | | | | | Instead of adding a new area for every single line, extend already existing areas when possible. (This was my original plan but I got lazy.)
* pager: percent-decode path name in askDownloadPathbptato2024-03-251-1/+1
|
* update readme, add doc/architecture.mdbptato2024-03-252-5/+361
|
* git.cgi: add "view" link to git switch panelbptato2024-03-251-1/+3
|
* layout: rework inline box area modelbptato2024-03-253-154/+180
| | | | | | | | | | | | | Specifying the background area as three LayoutUnit pairs sounds clever, but breaks down for text-align: center. * store line Y offset in LineBox - this is necessary to pass down areas we need to paint * refactor addHorizontalLine loop; remove mystery "If necessary, update ictx's width" line that used to be labeled "TODO this seems meaningless" and indeed seems meaningless now (I am prepared to deeply regret this later) * replace broken & convoluted startOffset/endOffset/size with a simple seq of offsets + sizes
* loader: fix failed doRequest handlingbptato2024-03-251-2/+1
| | | | copy-paste error
* buffer: fix getTitle never returning in some casesbptato2024-03-241-0/+2
|
* client, forkserver: remove useless codebptato2024-03-242-2/+0
|
* js: proper distinction between Opt/Optionbptato2024-03-2411-118/+110
| | | | | | | | | | | | | | | | until now, this had very strange (and inconsistent) semantics: * err() was used for exception propagation, but also as a null value * Option accepted undefined as a none value, but not null * Opt and Option were used interchangeably (and mostly randomly) Now, Result is always used for error reporting, and err(nil) means JS_EXCEPTION. (Opt is a special case of Result where we don't care about the error type, and is not used in JS.) Option on the other hand means "nullable variation of normally non-nullable type", and translates to JS_NULL. In JS we mainly use it for turning strings nullable.
* makefile: move cflags to appropriate variablebptato2024-03-241-2/+2
|
* makefile: use pkg-config for gmifetch ldflagsbptato2024-03-241-2/+3
|
* buffer: fix clonebptato2024-03-243-16/+11
|
* git.cgi: add custom git switchbptato2024-03-241-16/+35
| | | | just a clickable UI for switching branches
* cgi: reset SIGCHLD handler in childrenbptato2024-03-241-0/+4
| | | | this was causing problems in git.cgi
* ansi2html: add newline after pre tagbptato2024-03-241-1/+1
| | | | | it doesn't change anything in the dom, but this way it's easier to compose with other commands
* io: derive DynStream from RootObj (not Stream)bptato2024-03-2424-535/+293
| | | | | | | | This way they are no longer compatible, but we no longer need them to be compatible anyway. (This also forces us to throw out the old serialize module, and use packet writers everywhere.)
* pager: detect JS as textbptato2024-03-241-1/+5
| | | | | hack so it's possible to view JS code in a buffer even if it's set as e.g. application/javascript in user mime.types
* bufreader: add initPacketReaderbptato2024-03-243-7/+14
|
* buffer: form fixes & improvementsbptato2024-03-245-86/+130
| | | | | | | * fall back to text for unimplemented input types * add custom prompt to all text-like input types * show min/max for range * fix accidental override of repaint
* io: add bufreaderbptato2024-03-2110-261/+426
| | | | analogous to bufwriter
* config: add default-headers to siteconfbptato2024-03-215-48/+41
| | | | | | | So long as we have to live with siteconf, let's at least make it useful. Also, rewrite the header overriding logic because while it did work, it only did so accidentally.
* update readmebptato2024-03-211-5/+4
|
* term: use termcap for italic resetbptato2024-03-211-3/+7
|
* libregexp: update LRE_FLAG_UTF16 namebptato2024-03-213-3/+3
| | | | upstream now calls it unicode
* cell: update FormatFlag naming, remove useless templatesbptato2024-03-216-57/+45
|
* catom: at -> satbptato2024-03-216-196/+191
| | | | just for consistency
* loader: set static CGI env vars in initLoaderContextbptato2024-03-212-7/+8
| | | | no reason to do it separately in setupEnv
* main: refactor slightlybptato2024-03-212-149/+137
| | | | | | * put forkServer into main() * use a ctx type instead of closures * get rid of types/opt import
* ansi2html: add separate switch for "standalone"bptato2024-03-213-3/+9
| | | | | this way its output can be embedded into documents without a pointless DT declaration
* buffer: send title during load + other title stuffbptato2024-03-213-21/+35
| | | | | | | * send title to pager as soon as it's available * expose `title' to DOM * rename undocumented `getTitle' js function to `title' getter in Container
* buffer: also buffer input readsbptato2024-03-213-42/+55
| | | | this is buffer reading from pager
* ftp: basic sftp supportbptato2024-03-215-40/+135
| | | | | | | it still sucks, but it is at least slightly more usable. this also fixes a bug in dirlist where sort would mess up item name association
* pager: fix flipped predicate for downloadbptato2024-03-211-1/+1
| | | | we want to check if it's *not* text.
* buffer: also buffer reads for packetsbptato2024-03-202-16/+21
| | | | | Since we know the length of packets, we can also read them in in one call. Though I really wish we could do this without the StringStream.
* client: fix dump detectionbptato2024-03-201-7/+7
| | | | it wouldn't start dump mode if stdout was not a tty but stdin was.
* git.cgi: show command in title for logbptato2024-03-201-0/+3
|
* pager: add "save link", "save source"; change & document some keybindingsbptato2024-03-206-72/+139
| | | | | | | | | * `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