about summary refs log tree commit diff stats
path: root/src/main.nim
Commit message (Collapse)AuthorAgeFilesLines
* forkserver: simplify fcLoadConfigbptato2024-05-181-1/+1
|
* config: separate tmp dir for sockets, usersbptato2024-05-161-2/+3
| | | | | | | * 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
* Use isSome instead of isOkbptato2024-05-051-1/+1
| | | | no point in having identical overloads
* client: make quit() actually quit, misc fixesbptato2024-05-041-13/+16
| | | | | | | * unwind the QJS stack with an uncatchable exception when quit is called * clean up JS references in JSRuntime free even when the Nim counterparts are still alive * simplify some tests
* Add capsicum supportbptato2024-03-281-3/+4
| | | | | | | | | | | | | 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.
* config: improve input systembptato2024-03-261-1/+11
| | | | as described in <https://todo.sr.ht/~bptato/chawan/6>
* main: refactor slightlybptato2024-03-211-149/+134
| | | | | | * put forkServer into main() * use a ctx type instead of closures * get rid of types/opt import
* main: set CHA_LIBEXEC_DIR env var at startupbptato2024-03-191-1/+5
| | | | This way, we can use it everywhere (e.g. in mailcap).
* client: refactor inputbptato2024-03-181-3/+3
| | | | | * move mouse handling to term * do not use File for input just to disable buffering anyway
* config: clean up/simplifybptato2024-03-171-13/+13
| | | | | | | | | * 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-171-4/+0
| | | | seems like it confuses popen()
* main: ignore SIGCHLDbptato2024-03-171-0/+4
| | | | to avoid zombies
* Move around some modulesbptato2024-03-141-1/+1
| | | | | | | | * 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
* Replace Chakasu with Chagashibptato2024-02-221-1/+1
| | | | | | The API is horrid :( but at least it copies less. TODO: think of a better API.
* forkserver: clean upbptato2024-01-291-2/+1
| | | | | Move forkBuffer into forkserver (why was it in container anyway), remove unused mainproc variable, etc.
* Remove std/terminal dependencybptato2024-01-171-1/+1
| | | | It is mostly unnecessary, and conflicts with our use of termcap anyway.
* Use std/* imports everywherebptato2024-01-071-7/+4
|
* break up twtstr somewhatbptato2023-12-131-0/+1
| | | | | Avoid computing e.g. charwidth data for http which does not need it at all.
* config: better path handling; fix array parsing bugbptato2023-12-101-1/+8
| | | | | | | | | * 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.
* Move clang workaround to config.nimsbptato2023-11-211-4/+0
|
* Add -C optionbptato2023-10-271-144/+162
|
* Fix crash on `cha -'bptato2023-10-181-3/+5
|
* move workaround from previous commitbptato2023-10-051-0/+4
| | | | agh... it didn't work with GCC
* Accept bare strings in -o, fix -o with missing newlinebptato2023-09-201-1/+1
| | | | | | | | * Bare strings are now allowed when specifying config options through -o. * Fix a bug where options specified with -o would be disregarded unless a newline was included. * (Also, add a TOML stringifier routine for debugging.)
* main: set tmpdir for main processbptato2023-09-161-0/+2
|
* move around more modulesbptato2023-09-141-2/+2
| | | | | | | | | | * 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-1/+1
| | | | makes a bit more sense than the previous arrangement
* main: remove stray eprint, update -o info textbptato2023-09-061-2/+1
| | | | | QUIT was old-style declarative keybinding syntax, this is no longer supported.
* fix typobptato2023-09-061-2/+2
|
* main: allow grouped single-letter paramsbptato2023-09-051-59/+94
| | | | | so for example now -MV sets monochrome + visual mode instead of erroring out
* config: fix overriding default headersbptato2023-08-261-2/+0
| | | | | * simplify ActionMap reading * introduce separate case for Table
* Move charsets into chakasubptato2023-08-141-1/+4
| | | | Operation "modularize Chawan somewhat" part 1
* Add mailcap, mime.types & misc refactoringsbptato2023-08-131-9/+8
| | | | | | | | * add mailcap: works with copiousoutput, needsterminal, etc. * add mime.types (only works with mailcap) * refactor pipeBuffer * remove "dispatcher" * fix bug in directory display where baseurl would not be used
* Option -> Opt in config, return error in compileSearchRegexbptato2023-06-241-2/+3
|
* Add display/output encodingbptato2023-05-191-1/+12
| | | | Some encodings are still missing
* Refactor config, add charset optsbptato2023-05-161-12/+25
| | | | Only document-charset supported for now.
* Improve debugging, reduce crashesbptato2023-05-091-1/+6
| | | | Loader no longer dies when not everything is read from the stream.
* Make width table at compile-timebptato2023-01-271-1/+1
|
* Get rid of eprint in place of stderr.writebptato2023-01-051-2/+2
| | | | eprint should only be used for debugging.
* Add visual-home, rename undocumented config valuesbptato2022-12-111-1/+1
|
* Add -M, -Vbptato2022-12-051-4/+14
|
* *_HOME should be disabled when stdin *is* a ttybptato2022-11-301-1/+1
|
* Disable *_HOME when stdin is a ttybptato2022-11-301-1/+1
|
* Load fork-server config after parsing argumentsbptato2022-11-301-1/+1
|
* Support WWW_HOME, HTTP_HOMEbptato2022-11-301-0/+7
|
* Add textareabptato2022-11-281-14/+10
| | | | Editing is implemented using an external editor (like vi).
* Fix some regressions, add loading progress barbptato2022-11-271-1/+3
|
* Avoid forking child processes from the main processbptato2022-11-241-6/+14
| | | | Caveat: this breaks piped streams.
* Color & term improvementsbptato2022-11-211-0/+1
|
* Rewrite buffer/pager for multi-processingbptato2022-11-191-3/+4
|