about summary refs log tree commit diff stats
path: root/src/display
Commit message (Collapse)AuthorAgeFilesLines
* twtstr: fix deleteChars, do not remove space in replaceControlsbptato2024-03-141-5/+1
|
* term: fix alt-screen = true without ti/tebptato2024-03-081-10/+11
| | | | | | in this case just write smcup/rmcup also move down +1 line and reset formatting if alt screen is off
* Add mouse supportbptato2024-02-291-7/+28
|
* term: improve pixels-per-column/line detectionbptato2024-02-253-135/+165
| | | | | | | | | 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.)
* Allow non-RGB colors in CSSbptato2024-02-241-90/+101
| | | | | | | | | | | 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
* Replace Chakasu with Chagashibptato2024-02-222-19/+15
| | | | | | The API is horrid :( but at least it copies less. TODO: think of a better API.
* term: fix coloring messbptato2024-02-171-29/+171
| | | | | | | | | | | | | | | | | | | | | | | | | 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.)
* winattrs: remove unnecessary call, fix height_px fallbackbptato2024-02-171-1/+1
| | | | no need for every new buffer to query the window size
* layout: use html/body bgcolor as canvas bgcolorbptato2024-02-171-6/+7
| | | | | | 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.)
* Remove newFormatbptato2024-01-231-3/+3
| | | | Pointless; it just returned a default zero-initialized object.
* Re-design word handling, add e, E, W, B, etc.bptato2024-01-191-9/+9
| | | | | | | | | | | | * Add functions for moving to the beginning/end of words (vi `b', `e'). * As it turns out, there are many possible interpretations of what a word is. Now we have a function for each reasonable interpretation, and the default settings match those of vi (and w3m in w3m.toml). (Exception: it's still broken on line boundaries... TODO) * Remove `bounds` from lineedit, it was horrible API design and mostly useless. In the future, an API similar to what pager now has could be added. * Update docs, and fix some spacing issues with symbols in the tables.
* Remove std/terminal dependencybptato2024-01-172-53/+65
| | | | It is mostly unnecessary, and conflicts with our use of termcap anyway.
* Use std/* imports everywherebptato2024-01-073-14/+14
|
* Compile with styleCheck:usagesbptato2023-12-281-5/+5
| | | | much better
* break up twtstr somewhatbptato2023-12-132-0/+2
| | | | | Avoid computing e.g. charwidth data for http which does not need it at all.
* pager, container: add text selection/copyingbptato2023-12-031-3/+12
| | | | | | | | | | * 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 `\'
* pager: fix regressionbptato2023-11-211-2/+2
| | | | | pager.tty refers to infile, not outfile. rename to avoid further confusion
* bindings: find termcap on FreeBSDbptato2023-11-211-8/+8
| | | | | pkg-config does not find termcap (or really, ncurses) here, so we have to find it ourselves.
* pager: remove pager.tty memberbptato2023-11-211-4/+5
| | | | now it's a function
* term: replace control chars in setTitlebptato2023-10-201-1/+5
|
* WindowAttributes: refactorbptato2023-10-194-56/+64
| | | | | | * rename module (window -> winattrs, to avoid conflict with env/window) * do not use result * remove unused cell_ratio
* pager/lineedit: notify lineedit of windowChangebptato2023-10-181-0/+4
| | | | this was causing crashes
* term: un-export canvasbptato2023-10-011-1/+1
|
* lineedit: fix backspace bugbptato2023-09-301-1/+1
| | | | | We must decrease cursori by `len`, because exactly `len` bytes have been deleted from before the cursor.
* lineedit: add missing begin() calls in prevHist/nextHistbptato2023-09-201-0/+5
|
* lineedit: fix off by one error in killbptato2023-09-201-2/+2
|
* term: simplify/cleanupbptato2023-09-181-77/+17
|
* lineedit: fix a display bugbptato2023-09-181-1/+2
| | | | | The editor box never uses the last cell. However, it should still overwrite it.
* lineedit: rewritebptato2023-09-181-250/+200
| | | | | | | | | | | | | | | | The old lineedit system worked quite well in the original synchronous model. However, because it needs access to the terminal, it has been subtly broken ever since buffer updates are allowed while the user is in line edit mode. This is best observed in incremental search, where searching for a bgcolor'ed text would result in the bgcolor bleeding into the line editor box. The new version is much simpler, and therefore less optimized. But it can still take advantage of output optimization in the terminal controller, and it is free of races (because we simply query the current state from the pager and feed it into the main output grid).
* move around more modulesbptato2023-09-143-3/+426
| | | | | | | | | | * 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-142-1832/+0
| | | | makes a bit more sense than the previous arrangement
* Switch buffer -> client connection to client -> bufferbptato2023-09-141-30/+11
| | | | | | | | | | | | We now connect to buffers from the client, instead of connecting buffers to the client. This has the following advantages: * Simplifies the client event loop. * Makes the client a real client (no more serversocket dependency). * Slightly more secure, as we no longer have to trust buffers not lying about their process ids. * Facilitates the potential future addition of connections from several clients to a single buffer.
* Do not use mailcap for text/plainbptato2023-09-131-0/+5
|
* fix compilation on 1.6.14bptato2023-09-091-3/+3
| | | | changing addr semantics strikes again
* fetch: use JSDictbptato2023-09-091-2/+2
|
* javascript: add JSDict typebptato2023-09-091-13/+11
| | | | And use that in extern().
* add extern, refactor some term functionsbptato2023-09-093-53/+86
| | | | | | | | | | | * Add an extern() call. Maybe it should be defined on client. It certainly should accept a dictionary instead of the enum type we use now. Perhaps it should return the error code? I'll leave it undocumented until I figure this out. * Refactor enableRawMode, unblockStdin, etc. so that they operate on the term object instead of global state. * Move editor to a separate folder, and factor out runprocess into a different module.
* Add vi-style numeric prefixes, make gotoLine 1-basedbptato2023-09-081-8/+43
| | | | | | | | * it is now possible to jump to the nth line by typing {n}G * gotoLine is now 1-based, so to go to the first line you would use pager.gotoLine(1) * it is now allowed to return a function from a keybinding (which will be subsequently executed as a regular keybinding)
* fetch: allow string input, allow init dictionarybptato2023-09-081-2/+5
|
* Add btoa, atobbptato2023-09-071-0/+7
|
* javascript: factor out fromJSbptato2023-08-291-2/+3
|
* javascript: refactorbptato2023-08-282-1/+2
| | | | | | | Split out parts of the JS module, because it was starting to confuse the compiler a little. (Peakmem is back at 750M. Interesting.)
* Allow overriding default headersbptato2023-08-262-2/+2
|
* client: make `client.client' a getterbptato2023-08-201-1/+3
| | | | This way we do not need the ugly getProperty call.
* Move charsets into chakasubptato2023-08-143-4/+7
| | | | Operation "modularize Chawan somewhat" part 1
* Add mailcap, mime.types & misc refactoringsbptato2023-08-132-67/+334
| | | | | | | | * 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
* Fix double line bug in dump modebptato2023-07-291-1/+2
|
* Add default background/foreground color overridebptato2023-07-291-38/+39
|
* Add suspend() function (bound to C-z)bptato2023-07-261-0/+5
|
* Improve encoding supportbptato2023-07-122-31/+60
| | | | | | | | * Use the output charset in lineedit (as w3m does) * encoder: fix broken UTF-8 encoding, use openArray instead of var seq for input queue * Add RuneStream as an in-memory interface to EncoderStream * Document display-charset config option