| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
reshape must do a render from zero, as it's a last resort for users to
fixup the page on a rendering bug.
switchCharset must reset prevStyled for obvious reasons (it refers to
a dead document).
|
| |
|
|
|
|
|
| |
they will replace the target container on connection, so inserting them
in a different place first results in strange navigation bugs
|
|
|
|
|
|
|
|
|
|
|
|
| |
* reduce onload result size to a single int
* clean up mess that was the container onload handler
This fixes automatic refresh in console. Before, the client would
only request a screen update after receiving the number of bytes read,
but before the screen was actually reshaped (which obviously resulted
in a race condition). Now, "I've reshaped the document" is a separate
response (and is the only occasion where the screen is updated before
the final render).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Get rid of sostream hack
This is no longer needed, and was in fact causing loadStream to get
stuck with redirects on regular files (i.e. the common case of receiving
<file on stdin without a -T content type override).
* Unify loading from cache and stdin regular file code paths
Until now, loadFromCache was completely sync. This is not a huge
problem, but it's better to make it async *and* not have two separate
procedures for reading regular files. (In fact, loadFromCache had
*another* bug related to its output fd not being added to outputMap.)
* Extra: remove ansi2html select error handling
It was broken, because it didn't handle read events before the
error. Also unnecessary, since recvData breaks from the loop on n == 0.
|
|
|
|
|
|
|
|
|
| |
Some terminal emulators (AKA vte) refuse to set ws_xpixel and ws_ypixel
in the TIOCGWINSZ ioctl, so we now query for CSI 14 t as well. (Also CSI
18 t for good measure, just in case we can't ioctl for some reason.)
Also added some fallback (optionally forced) config values for width,
height, ppc, and ppl. (This is especially useful in dump mode.)
|
|
|
|
|
| |
`confidence' becomes ccCertain when PRES_STOP is returned, so asserting
the opposite is incorrect (and was resulting in crashes).
|
|
|
|
|
|
|
|
|
|
| |
This way, we do not end up with ugly contrast-corrected white on
terminals with arbitrary backgrounds by default. (Now we get the native
-cha-ansi(default) instead).
(We leave background-color as transparent; this should have the same
effect, since defaultColor as bgcolor is ignored, but makes more sense
(and will allow us to un-ignore defaultColor as bgcolor in the future.))
|
|
|
|
|
|
|
|
| |
Cache mailcap entry output too, then delete it when the buffer can no
longer read from it.
(Maybe it would be useful to instead preserve it and allow viewSource
for HTML output too? Hmm.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Handling text/plain as ANSI colored text was problematic for two
reasons:
* You couldn't actually look at the real source of HTML pages or text
files that used ANSI colors in the source. In general, I only want
ANSI colors when piping something into my pager, not when viewing any
random file.
* More importantly, it introduced a separate rendering mode for
plaintext documents, which resulted in the problem that only some
buffers had DOMs. This made it impossible to add functionality
that would operate on the buffer's DOM, to e.g. implement w3m's
MARK_URL. Also, it locked us into the horribly inefficient line-based
rendering model of entire documents.
Now we solve the problem in two separate parts:
* text/x-ansi is used automatically for documents received through
stdin. A text/x-ansi handler ansi2html converts ANSI formatting to
HTML. text/x-ansi is also used for .ans, .asc file extensions.
* text/plain is a separate input mode in buffer, which places all text
in a single <plaintext> tag. Crucially, this does not invoke the HTML
parser; that would eat NUL characters, which we should avoid.
One blind spot still remains: copiousoutput used to display ANSI colors,
and now it doesn't. To solve this, users can put the x-ansioutput
extension field to their mailcap entries, which behaves like
x-htmloutput except it first pipes the output into ansi2html.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The -cha-ansi color type now sets ANSI colors in CSS.
Also, color correction etc. has been improved a bit:
* don't completely reset output state in processFormat for new colors
* defaultColor is now separated from ANSI color type 0
* bright ANSI colors are no longer replaced with bold + dark variant
* replaced ANSI color map to match xterm defaults
|
|
|
|
| |
aaaaaa
|
|
|
|
| |
:/
|
|
|
|
|
|
|
|
| |
It's better to not implement them at all than to implement them badly.
(In particular, making fixed act like absolute breaks horribly on
websites that actually use it. Fixing it is not really possible without
changinge the way we currently draw things to the screen.)
|
| |
|
|
|
|
| |
instead of trying to evaluate exceptions...
|
|
|
|
|
|
|
|
| |
It is a very bad idea to add it before that, because it could be closed
for various reasons without being removed from the map.
More concretely, this was causing ghost ostream fds to block istream
selects in some cases.
|
| |
|
|
|
|
|
|
| |
* cancel resources on cancel() call
* call _exit in signal handler (also in loader)
* misc cleanups
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Aside from being a wrapper of Request, it was just storing the -I
charset, except even that didn't actually work. Whoops.
This fixes -I effectively not doing anything; now it's a forced override
that even disables BOM sniffing. (If the user wants to decode a file
using a certain encoding, it seems wise to assume that they really
meant it.)
|
|
|
|
|
|
|
|
|
|
| |
This fixes a bug where setContentType would call setHTML twice, which
messed up charsets and probably a couple more things. As a bonus, it
allows us to pass around the content type less.
In fact, buffer does not have to know its exact content type, just
whether it is in HTML mode or not. So that's all we tell it now;
only container still keeps track of the content type (as it should).
|
|
|
|
|
|
| |
default-flags was overly complicated for its purpose.
Also, ignore-case is quite useful, so enable it by default.
|
|
|
|
|
|
| |
The API is horrid :( but at least it copies less.
TODO: think of a better API.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The way `justify' was implemented just made text annoying to read.
(The algorithm of distributing spacing evenly does not really work
on a cell-based screen because of rounding errors.)
CSS 2.1 says:
> Conforming user agents may interpret the value 'justify' as 'left' or
> 'right', depending on whether the element's default writing direction
> is left-to-right or right-to-left, respectively.
Since we have no bidi yet, just interpret it as `left'.
Maybe in the future we could add an implementation that tries to align
line box lengths instead of their contents, but this will probably be
difficult to get right.
|
|
|
|
|
|
| |
The first line is already ignored in the calculations, but it was still
being re-positioned in positionAtoms, which made lines overlap in some
cases.
|
| |
|
|
|
|
|
| |
* set loaderPid in clones too
* handle URL in container the same way as in buffer
|
|
|
|
|
| |
source.request.url is not used after buffer initialization (because it
may be replaced later), so we must set buffer.url instead.
|
|
|
|
|
| |
* do not eat \\c, \\C
* emulate vi-style word boundary matching (\<, \>) with \b
|
|
|
|
| |
We have less than 8 flags, so the set's size is 1.
|
| |
|
| |
|
|
|
|
|
|
|
| |
I've gotten tired of not being able to search for forward slashes.
Now it works like in vim, and you can also set default ignore case in
the config.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Until now, the config file required manual adjustment for the output to
look bearable on terminals colored differently than {bgcolor: black,
fgcolor: white}. Also, it only detected RGB when COLORTERM was set, but
this is not done by most (any?) terminal emulators (sad).
To improve upon the situation, we now query the terminal for some
attributes on startup:
* OSC(10/11, ?) -> get the terminal's bg/fgcolor
* DCS(+, q, 524742) -> XTGETTCAP for the "RGB" capability (only
supported by a few terminals, but better than nothing)
* Primary device attributes -> check if ANSI colors are supported, also
make sure we don't block indefinitely even if the previous queries
fail
If primary device attributes does not return anything, we hang until
the user types something, then notify the user that something went
wrong, and tell them how to fix it. Seems like an OK fallback.
(The DA1 idea comes from notcurses; since this is implemented by pretty
much every terminal emulator, we don't have to rely on slow timing hacks
to skip non-supported queries.)
|
|
|
|
| |
no need for every new buffer to query the window size
|
|
|
|
|
|
|
| |
The `t' field was completely redundant, as it's already included in the
CSSComputedValues index.
+ removed some unused functions
|
|
|
|
|
|
| |
* fix accidental dependency on previously chosen bgcolor (ouch)
* also draw empty background boxes for bgcolor-is-canvas boxes
* remove unused variable
|
|
|
|
|
|
| |
This is required by the standard. (Without this, lots of websites have
incorrect background colors, because they set the body height to 100%
of the viewport.)
|
|
|
|
|
|
|
|
| |
charwidth is specifically intended to represent the width of all
characters until the current one, so resetting it for words makes no
sense. Originally it was reset for all atoms *except* words; 9fdea97d
simplified the code incorrectly (flipped the logic) and thus introduced
a regression.
|
| |
|
|
|
|
|
| |
Without this we were wrapping on the last dash (if any) inside CJK
sentences.
|
|
|
|
| |
but I forgot to ensure the output stream gets closed. :(
|
|
|
|
|
|
|
|
| |
cha -d <some-file was crashing loader, because it was trying to register
the regular file in the selector.
this patch fixes the problem, but the control flow of loader looks like
spaghetti now
|
|
|
|
| |
otherwise pages from stdin have a race condition in dump
|
|
|
|
| |
Return the empty string if it's unset.
|
|
|
|
|
|
| |
Otherwise, container will just happily kill the buffer and with it the
loader process before it would have had the chance to stream out the
input into the external process.
|
|
|
|
|
|
|
|
| |
* disallow Stream interface usage on non-blocking PosixStreams
* do not read estream of forkserver byte-by-byte (it's slow)
* do not call writeData with a zero len in formdata
* do not quote numbers in mailcap quoteFile
* remove some unused stuff
|