| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Unsigned operations and conversions to unsigned types always wrap/narrow
without checks, so no need to manually mask/cast/etc. them.
|
|
|
|
| |
the status line can't have images, so this should work
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* png: add missing filters, various decoder fixes
* term: fix kitty response interpretation, add support for kitty image
detection
* buffer, pager: initial image display support
Emphasis on "initial"; it only "works" with kitty output and PNG input.
Also, it's excruciatingly slow, and repaints images way too often.
Left undocumented intentionally it for now, until it actually becomes
useful. In the meantime, adventurous users can find out themselves why:
[[siteconf]]
url = "https://.*"
images = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We use libseccomp, which is now a semi-mandatory dependency on Linux.
(You can still build without it, but only if you pass a scary long flag
to make.)
For this to work I had to disable getTimezoneOffset, which would
otherwise call localtime_r which in turn reads in some files from
/usr/share/zoneinfo. To allow this we would have to give unrestricted
openat(2) access to buffer processes, which is unacceptable.
(Giving websites access to the local timezone is a fingerprinting vector
so if this ever gets fixed then it should be an opt-in config setting.)
This patch also includes misc fixes to buffer cloning, and fixes the
LIBEXECDIR override in the makefile so that it is actually useful.
|
|
|
|
|
|
| |
* separate params with ; (semicolon) instead of , (colon)
* reduce screaming snake case use
* wrap long lines
|
|
|
|
|
|
|
|
|
| |
It is quite straightforward, because XTerm has a functionality to do
just this.
(In fact, it automatically restores the title when I use smcup/rmcup.
But when I don't, it will linger until I close the window or change the
title again.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's a bad idea for several reasons:
* it's inefficient; must allocate an environment for a closure in Nim,
even though we already have one in JS
* writing macros for automatically creating functions with variadic
arguments is suprisingly difficult (see the entire `js/javascript'
module)
* it never really worked properly, because we never freed the associated
function pointer.
We hardly used it anyway, so the easiest fix is to get rid of it
completely.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is broken in w3m too, so we take nvi behavior instead. Also, we now
consistently complain when the user tries to search for an empty string
instead of just occasionally spitting out "invalid regex" alerts.
(In w3m, /search^M/^M just jumps to the first search result with
ISEARCH. In nvi, it jumps to the second one with both searchincr on
and off.
w3m only produces the latter behavior with regular search, which is I
assume why I made it work this way, but it's still inconsistent for no
good reason.)
|
|
|
|
|
|
|
|
|
| |
For some reason, halfPageDown decremented height instead of incrementing
it, which caused some rather weird behavior where halfPageUp +
halfPageDown would put the cursor in a different position than it was
before.
Also, we must increment *before* dividing to mimic vi behavior properly.
|
| |
|
|
|
|
|
|
|
| |
* URI-decode path name for local files in default config
* (ab)use mailcap command quoting for passing params to editor command
instead of replicating it badly in formatEditorName
* rename mailcap enums
|
| |
|
| |
|
|
|
|
|
| |
seems like a good idea, especially because CGI uses stdout as the IPC
mechanism
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
some terminals (alacritty) don't support XTGETTCAP and don't even
respond with ANSI color support to DA1, so just fall back to termcap.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
as described in <https://todo.sr.ht/~bptato/chawan/6>
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
| |
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.)
|
|
|
|
|
| |
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
|
|
|
|
| |
analogous to bufwriter
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
upstream now calls it unicode
|
| |
|
|
|
|
|
|
|
| |
* send title to pager as soon as it's available
* expose `title' to DOM
* rename undocumented `getTitle' js function to `title' getter in
Container
|
|
|
|
| |
this is buffer reading from pager
|
|
|
|
| |
we want to check if it's *not* text.
|
|
|
|
| |
it wouldn't start dump mode if stdout was not a tty but stdin was.
|
|
|
|
|
|
|
|
|
| |
* `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
|
|
|
|
| |
it's text, so we can display it anyway.
|
|
|
|
| |
Useful when browsing plaintext files; w3m has it too.
|
|
|
|
|
| |
* move mouse handling to term
* do not use File for input just to disable buffering anyway
|
|
|
|
|
|
| |
Better (and simpler) than storing them all over the place.
extra: change lmDownload text to match w3m
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
it's an unintended side effect that we do not want
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
* do not immediately quit when all containers are gone
* fix double saving bug
* fix wrong "save to" string
|
|
|
|
|
| |
we do have logic for this in replace(), but it was not working because
setContainer changed the buffer too early.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.)
|