| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Dump mode remains the same, except now it can be controlled in
config.toml as well.
|
|
|
|
|
|
|
|
| |
Significantly more efficient in long running commands (as the context
switch is gone).
For many commands in quick succession... it replaces the fcntl with
a tcsetattr, so I guess it's the same?
|
|
|
|
| |
ref. https://todo.sr.ht/~bptato/chawan/44
|
|
|
|
|
|
|
|
|
|
| |
The intent behind the original design was that the page shouldn't change
without user interaction. This sounds good in theory, but in practice
it's unnecessary if you disable JS (nothing will modify the page), and
annoying if you enable it (breaks pages that load with AJAX).
So now we queue a task to notify us when the page has been updated, and
act accordingly when the task is completed.
|
|
|
|
|
|
|
|
|
|
| |
pager: I want to change mailcap command parsing, so a custom
implementation is needed.
term: now it uses a custom buffer for the output stream too.
I don't think there is much difference in performance, but stdio was in
the way.
(Also, this way it will be easier to make it async in the future.)
|
|
|
|
|
| |
I got tired of submodules.
This commit doesn't build; subtrees incoming...
|
|
|
|
| |
also remove some unused fields of Container
|
|
|
|
|
|
| |
We already need a camel -> kebab converter anyway.
Unfortunately this also changes JS binding names, so it's a breaking
change. Oh well.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Now we just pass through a socket created in pager.
This removes the need for a socket directory, and strengthens the buffer
sandbox slightly.
I've kept the ServerSocket code, because I want to add some form of RPC
and communication between separate instances in the future. However,
I don't expect this to be handled outside the main process, so I've
removed the Capsicum-specific connectat/bindat code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, each message (load, resume, passFd, etc.) would open a new
connection to loader's UNIX socket, and assumed the loader was dead
when the loader did not respond (ECONNREFUSED).
As it turns out, this model was hopelessly broken: POSIX does not
specify when a UNIX socket can refuse connections, so while it happened
to work on Linux (which just blocks if it can't accept right now),
FreeBSD would randomly refuse connections whenever its listen queue was
full.
Instead, we now take a socketpair() from the loader in addClient, and
pass on one half to the client (the other half stays in loader); this is
the control stream, and all messages from the specific client are sent
through it. If a message includes a new stream (e.g. lcLoad), then it
sends a new socketpair through the control stream.
Aside from not being completely broken (and being marginally more
efficient), this arrangement has several other benefits: it removes the
need for authentication, almost removes the need for sockdir (now only
buffers use it), and will make it easier to add async message processing
in the future.
|
|
|
|
|
|
|
|
|
|
| |
FD_CLOEXEC should hopefully get rid of bugs where buffers outlived the
main process because of some stray child process keeping the canary
pipe alive.
It's not perfect because of the runMailcapWriteFile/runMailcapReadFile
double-forks. Ideally they should be replaced with an implementation
that tracks temporary files in the main process.
|
|
|
|
|
|
|
| |
It isn't really limited to config. It just happens to be in
XDG_CONFIG_HOME because XDG basedirs suck.
(W3M_DIR works similarly.)
|
| |
|
|
|
|
|
| |
It's still missing a "color visited links" feature, but it's better
than nothing.
|
|
|
|
|
|
|
|
| |
not completely, because that would break the existing API :/
this also fixes the broken interruptHandler - it no longer crashes,
but it's still inefficient... probably it should "just" handle SIGINT
instead
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* use PosixStream/mmap for mailcap reading too; this finally lets us get
rid of std/streams in the entire codebase
* split up recvDataLoopOrMmap into 3 functions: one that can fall back
to recvAll, one that falls back to recvDataLoop, and one that does not
fall back to anything
* use MAP_PRIVATE in mmap for read (we don't care if changes are
propagated, as we do no changes to cached files)
|
|
|
|
|
|
|
|
|
|
|
|
| |
* remove std/streams use from mime.types; mmap and parse directly
* use mime.types for inline image extensions
* add some jpeg file extensions
Latter came up because I was trying to add a format locally and it
wouldn't recognize it on images from my file system (i.e. by extension).
As a security measure we still do not allow additional extensions for
predefined inline image types.
|
|
|
|
| |
it's unambiguous anyway
|
|
|
|
|
|
|
| |
one std/streams less
I used mmap for reading the user config. It shouldn't matter in any
realistically sized config, but who knows.
|
| |
|
|
|
|
| |
for consistency
|
| |
|
|
|
|
|
|
|
|
|
| |
* fix incorrect :- behavior
* merge non-standard '${%VARIABLE}' syntax with regular syntax; now all
internal variables are exported to the environment, so the behavior
should be equivalent.
* handle terminal symbol appropriately in all states
* deny numeric curly substitutions
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I'm starting to favor dotfiles over XDG basedirs, but there's no reason
why we couldn't have both. So now the search path is:
0. if config was set through -C, use that
1. $CHA_CONFIG_DIR is set -> $CHA_CONFIG_DIR/config.toml
2. $XDG_CONFIG_HOME is set -> $XDG_CONFIG_HOME/chawan/config.toml
3. ~/.config/chawan/config.toml exists -> use that
4. ~/.chawan/config.toml exists -> use that
Notably, this makes it so the default directory is ~/.chawan *if* you
don't have an existing config.toml file. So in that case known_hosts
will be placed in ~/.chawan/known_hosts. However, configurations with a
config in ~/.config/chawan/config.toml continue to work as expected, as
for those the known_hosts file remains inside ~/.config/chawan/.
Finally, I've added a default user CGI directory to reduce friction in
setting CGI up. (Like known_hosts, it's also relative to whatever config
dir you have.)
|
|
|
|
|
| |
again, not that useful to put it in a separate module if only term
uses it
|
|
|
|
|
|
|
|
|
|
| |
This finally makes it possible to use socks5 for Gemini.
Also slightly refactored the config, to make it easier to pass on the
config dir.
By the way, the known_hosts file is now stored in the config dir too.
The adapter will try to move it to there from the old location.
|
|
|
|
|
|
|
|
| |
If TERM is unrecognized by termcap, retry as dosansi.
When that fails, just fall back to the non-termcap code path.
(There is no reason to panic without termcap; it's just one of the
several capability detection mechanisms we use.)
|
|
|
|
|
| |
Merge "load config" with "fork loader", so that the loader process gets
forked one packet earlier.
|
| |
|
|
|
|
| |
Operation "modularize Chawan somewhat" part 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
|
|
|
|
| |
no point in having identical overloads
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
as described in <https://todo.sr.ht/~bptato/chawan/6>
|
|
|
|
|
|
| |
* put forkServer into main()
* use a ctx type instead of closures
* get rid of types/opt import
|
|
|
|
| |
This way, we can use it everywhere (e.g. in mailcap).
|
|
|
|
|
| |
* move mouse handling to term
* do not use File for input just to disable buffering anyway
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
seems like it confuses popen()
|
|
|
|
| |
to avoid zombies
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
| |
The API is horrid :( but at least it copies less.
TODO: think of a better API.
|
|
|
|
|
| |
Move forkBuffer into forkserver (why was it in container anyway), remove
unused mainproc variable, etc.
|
|
|
|
| |
It is mostly unnecessary, and conflicts with our use of termcap anyway.
|