about summary refs log tree commit diff stats
path: root/src/local/client.nim
Commit message (Collapse)AuthorAgeFilesLines
* Remove CLONE BufferSource; cache document sources in tmpdirbptato2024-02-121-3/+0
| | | | | | | | | | | | | | | | | | | | | | | At last all BufferSources are unified. To achieve the same effect as the previous CLONE source type, we now use the "fromcache" flag in Request. This *forces* the document to be streamed from the disk; if the file no longer exists for some reason, an error is returned (i.e. the document is not re-downloaded). For a document to be cached, it has to be the main document of the buffer (i.e. no additional resources requested with fetch()), and also not an x-htmloutput HTML file (for those, the original source is saved). The result is that toggleSource now always returns the actual source for e.g. markdown files, not the HTML-transformed version. Also, it is now possible to view the source of a document that is still being downloaded. buffer.sstream has almost been eliminated; it still exists, but only as a pseudo-buffer to interface with EncoderStream and DecoderStream. It no longer holds the entire source of a buffer at any point, and is cleared as soon as the buffer is completely loaded.
* Get rid of LOAD_PIPE BufferSourcebptato2024-02-111-3/+3
| | | | | Instead, use a stream: scheme and associate hostnames with file descriptors directly from the pager.
* forkserver: clean upbptato2024-01-291-4/+2
| | | | | Move forkBuffer into forkserver (why was it in container anyway), remove unused mainproc variable, etc.
* client: stop entire process group on suspend()bptato2024-01-291-1/+1
| | | | | * pass 0 so e.g. git does not hang * use sigtstp so e.g. cgi scripts can clean up if needed
* Remove std/terminal dependencybptato2024-01-171-1/+0
| | | | It is mostly unnecessary, and conflicts with our use of termcap anyway.
* js: merge some type modules into jstypesbptato2024-01-111-1/+1
| | | | They only had type definitions, no need to put them in separate modules.
* Use std/* imports everywherebptato2024-01-071-11/+11
|
* Set cgiDir for client loader processbptato2024-01-061-1/+3
|
* Compile with styleCheck:usagesbptato2023-12-281-3/+3
| | | | much better
* client: nil check connectSocketStream resultbptato2023-12-141-0/+5
| | | | | It may fail if the buffer process could not successfully create a server socket.
* client: avoid nil defect in flushConsolebptato2023-12-141-0/+5
|
* pager: add marksbptato2023-12-091-0/+7
| | | | | Default is vi-style, but w3m-style marks work as well; see bonus/w3m.toml.
* pager, container: add text selection/copyingbptato2023-12-031-11/+23
| | | | | | | | | | * Add select & copy selection functionality to container * Fix bug in generateSwapOutput where output could be misplaced because of zero-width cells * Add fromJSPromise, call runJSJobs in every iteration of the headed event loop * "await" pager actions that output a promise * Change default view source keybinding to `\'
* Get rid of clang 16 workaroundbptato2023-12-021-5/+6
| | | | | * bindings/quickjs: importc and use correct pointer types * add constcharp module for when it is unavoidable
* pager: fix regressionbptato2023-11-211-14/+14
| | | | | pager.tty refers to infile, not outfile. rename to avoid further confusion
* Remove trailing spacesbptato2023-10-231-1/+1
|
* base64: reduce pointless re-coding using JSStringbptato2023-10-211-2/+3
| | | | | We now expose some functions from QuickJS to interact with JavaScript strings without re-encoding them into UTF-8.
* javascript: add TextEncoder, TextDecoderbptato2023-10-211-0/+2
|
* WindowAttributes: refactorbptato2023-10-191-1/+1
| | | | | | * rename module (window -> winattrs, to avoid conflict with env/window) * do not use result * remove unused cell_ratio
* Refactor Consolebptato2023-10-131-70/+96
| | | | | * merge dom.console & client.Console * move client-specific stuff out of Console (into callbacks when necessary)
* Add w3m-cgi-compat optionbptato2023-10-011-1/+2
|
* Add urimethodmap supportbptato2023-09-301-0/+1
| | | | yay
* pager: show character sequence inputs on status linebptato2023-09-261-23/+25
| | | | pretty useful I think
* client: write errors to browser console in evalActionbptato2023-09-251-3/+10
|
* client: clean up Client objectbptato2023-09-241-14/+5
| | | | | * remove unused attributes * make line a function
* client, timeout: simplifybptato2023-09-241-8/+8
| | | | | We don't use the generic feature of selectors, so just unify the client & buffer timeout types.
* Disable "toggle source" for the console bufferbptato2023-09-211-1/+2
|
* Fix compilation with --assertions:offbptato2023-09-151-2/+4
| | | | | Remove side effects from assert statements. The flag is not used currently, but let's not depend on that.
* bindings: fix JSInterruptHandler signaturebptato2023-09-151-1/+1
|
* move around more modulesbptato2023-09-141-8/+8
| | | | | | | | | | * ips -> io/ * loader related stuff -> loader/ * tempfile -> extern/ * buffer, forkserver -> server/ * lineedit, window -> display/ * cell -> types/ * opt -> types/
* move some modules to local/bptato2023-09-141-0/+643
makes a bit more sense than the previous arrangement